Core/Misc: Another batch of fixes for issues found by static analysis
This commit is contained in:
1 parent
933f50558b
commit
7da33b6bce
6 files changed
+15
-53
No files matched your search
@@ -1071,9 +1071,7 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
uint32 zone_id = player->GetZoneId();
|
||||
|
||||
WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard(
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), team);
|
||||
|
||||
WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), team);
|
||||
if (graveyard)
|
||||
{
|
||||
uint32 graveyardId = graveyard->ID;
|
||||
@@ -1103,14 +1101,12 @@ public:
|
||||
{
|
||||
std::string team_name;
|
||||
|
||||
if (team == 0)
|
||||
team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
|
||||
else if (team == HORDE)
|
||||
if (team == HORDE)
|
||||
team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
|
||||
else if (team == ALLIANCE)
|
||||
team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
|
||||
|
||||
if (team == ~uint32(0))
|
||||
if (!team)
|
||||
handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAVEYARDS, zone_id);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id, team_name.c_str());
|
||||
@@ -2144,7 +2140,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32 school = schoolStr ? atoi((char*)schoolStr) : SPELL_SCHOOL_NORMAL;
|
||||
uint32 school = atoi((char*)schoolStr);
|
||||
if (school >= MAX_SPELL_SCHOOL)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in new issue
Block a user