Core/Misc: Fix static analysis issues reported by Coverity Scan

(cherry picked from commit de88691e25)
This commit is contained in:
jackpoz
2019-06-28 22:18:30 +02:00
committed by Shauren
parent 88457030cc
commit 841630fcc3
9 changed files with 13 additions and 7 deletions

View File

@@ -183,6 +183,7 @@ void CharacterCache::UpdateCharacterArenaTeamId(ObjectGuid const& guid, uint8 sl
if (itr == _characterCacheStore.end())
return;
ASSERT(slot < 3);
itr->second.ArenaTeamId[slot] = arenaTeamId;
}
@@ -295,7 +296,9 @@ uint32 CharacterCache::GetCharacterArenaTeamIdByGuid(ObjectGuid guid, uint8 type
if (itr == _characterCacheStore.end())
return 0;
return itr->second.ArenaTeamId[ArenaTeam::GetSlotByType(type)];
uint8 slot = ArenaTeam::GetSlotByType(type);
ASSERT(slot < 3);
return itr->second.ArenaTeamId[slot];
}
bool CharacterCache::GetCharacterNameAndClassByGUID(ObjectGuid guid, std::string& name, uint8& _class) const