mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/Misc: Fixed some more issues found by static code analysis tools.
This commit is contained in:
@@ -544,7 +544,11 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target
|
||||
float cords[4] = {banner->GetPositionX(), banner->GetPositionY(), banner->GetPositionZ(), banner->GetOrientation() };
|
||||
|
||||
DelObject(nodePoint[i].gameobject_type);
|
||||
AddObject(nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry, cords[0], cords[1], cords[2], cords[3], 0, 0, 0, 0, RESPAWN_ONE_DAY);
|
||||
if (!AddObject(nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry, cords[0], cords[1], cords[2], cords[3], 0, 0, 0, 0, RESPAWN_ONE_DAY))
|
||||
{
|
||||
TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: There was an error spawning a banner. Isle of Conquest BG canceled", nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry);
|
||||
Battleground::EndBattleground(WINNER_NONE);
|
||||
}
|
||||
|
||||
GetBGObject(nodePoint[i].gameobject_type)->SetUInt32Value(GAMEOBJECT_FACTION, nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_Factions[1] : BG_IC_Factions[0]);
|
||||
|
||||
@@ -641,10 +645,13 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
|
||||
for (uint8 u = 0; u < MAX_HANGAR_TELEPORTERS_SPAWNS; ++u)
|
||||
{
|
||||
uint8 type = BG_IC_GO_HANGAR_TELEPORTER_1+u;
|
||||
AddObject(type, (nodePoint->faction == TEAM_ALLIANCE ? GO_ALLIANCE_GUNSHIP_PORTAL : GO_HORDE_GUNSHIP_PORTAL),
|
||||
if (!AddObject(type, (nodePoint->faction == TEAM_ALLIANCE ? GO_ALLIANCE_GUNSHIP_PORTAL : GO_HORDE_GUNSHIP_PORTAL),
|
||||
BG_IC_HangarTeleporters[u].GetPositionX(), BG_IC_HangarTeleporters[u].GetPositionY(),
|
||||
BG_IC_HangarTeleporters[u].GetPositionZ(), BG_IC_HangarTeleporters[u].GetOrientation(),
|
||||
0, 0, 0, 0, RESPAWN_ONE_DAY);
|
||||
0, 0, 0, 0, RESPAWN_ONE_DAY))
|
||||
{
|
||||
TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: There was an error spawning a gunship portal. Type: %u", BG_IC_GO_HANGAR_TELEPORTER_1+u);
|
||||
}
|
||||
}
|
||||
|
||||
//TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "BG_IC_GO_HANGAR_BANNER CAPTURED Faction: %u", nodePoint->faction);
|
||||
|
||||
@@ -43,7 +43,9 @@ ChannelMgr* ChannelMgr::forTeam(uint32 team)
|
||||
Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channelId)
|
||||
{
|
||||
std::wstring wname;
|
||||
Utf8toWStr(name, wname);
|
||||
if (!Utf8toWStr(name, wname))
|
||||
return NULL;
|
||||
|
||||
wstrToLower(wname);
|
||||
|
||||
ChannelMap::const_iterator i = channels.find(wname);
|
||||
@@ -61,7 +63,9 @@ Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channelId)
|
||||
Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pkt)
|
||||
{
|
||||
std::wstring wname;
|
||||
Utf8toWStr(name, wname);
|
||||
if (!Utf8toWStr(name, wname))
|
||||
return NULL;
|
||||
|
||||
wstrToLower(wname);
|
||||
|
||||
ChannelMap::const_iterator i = channels.find(wname);
|
||||
@@ -84,7 +88,9 @@ Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pk
|
||||
void ChannelMgr::LeftChannel(std::string const& name)
|
||||
{
|
||||
std::wstring wname;
|
||||
Utf8toWStr(name, wname);
|
||||
if (!Utf8toWStr(name, wname))
|
||||
return;
|
||||
|
||||
wstrToLower(wname);
|
||||
|
||||
ChannelMap::const_iterator i = channels.find(wname);
|
||||
|
||||
@@ -630,7 +630,9 @@ void WorldSession::HandlePetRename(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
std::wstring wname;
|
||||
Utf8toWStr(name, wname);
|
||||
if (!Utf8toWStr(name, wname))
|
||||
return;
|
||||
|
||||
if (!ObjectMgr::CheckDeclinedNames(wname, declinedname))
|
||||
{
|
||||
SendPetNameInvalid(PET_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME, name, &declinedname);
|
||||
|
||||
Reference in New Issue
Block a user