[12169] Fix some problems detected by static code analysis

This commit is contained in:
zerg 2012-09-02 13:14:02 +06:00 committed by Antz
parent 62118e099e
commit b8b907c138
4 changed files with 6 additions and 5 deletions

View file

@ -1257,7 +1257,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround* bg)
if (type) // arena if (type) // arena
{ {
// it seems this must be according to BG_WINNER_A/H and _NOT_ BG_TEAM_A/H // it seems this must be according to BG_WINNER_A/H and _NOT_ BG_TEAM_A/H
for (uint8 i = 1; i >= 0; --i) for (int8 i = 1; i >= 0; --i)
{ {
uint32 pointsLost = bg->m_ArenaTeamRatingChanges[i] < 0 ? abs(bg->m_ArenaTeamRatingChanges[i]) : 0; uint32 pointsLost = bg->m_ArenaTeamRatingChanges[i] < 0 ? abs(bg->m_ArenaTeamRatingChanges[i]) : 0;
uint32 pointsGained = bg->m_ArenaTeamRatingChanges[i] > 0 ? bg->m_ArenaTeamRatingChanges[i] : 0; uint32 pointsGained = bg->m_ArenaTeamRatingChanges[i] > 0 ? bg->m_ArenaTeamRatingChanges[i] : 0;
@ -1267,7 +1267,8 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround* bg)
*data << uint32(0); // Matchmaking Value *data << uint32(0); // Matchmaking Value
DEBUG_LOG("rating change: %d", bg->m_ArenaTeamRatingChanges[i]); DEBUG_LOG("rating change: %d", bg->m_ArenaTeamRatingChanges[i]);
} }
for (uint8 i = 1; i >= 0; --i)
for (int8 i = 1; i >= 0; --i)
{ {
uint32 at_id = bg->m_ArenaTeamIds[i]; uint32 at_id = bg->m_ArenaTeamIds[i];
ArenaTeam* at = sObjectMgr.GetArenaTeamById(at_id); ArenaTeam* at = sObjectMgr.GetArenaTeamById(at_id);

View file

@ -4780,7 +4780,7 @@ void ObjectMgr::LoadInstanceTemplate()
if (!parentEntry) if (!parentEntry)
{ {
sLog.outErrorDb("ObjectMgr::LoadInstanceTemplate: bad parent map id %u for instance template %d template!", sLog.outErrorDb("ObjectMgr::LoadInstanceTemplate: bad parent map id %u for instance template %d template!",
parentEntry->MapID, temp->map); temp->parent, temp->map);
const_cast<InstanceTemplate*>(temp)->parent = 0; const_cast<InstanceTemplate*>(temp)->parent = 0;
continue; continue;
} }

View file

@ -581,7 +581,7 @@ uint32 PathFinder::fixupCorridor(dtPolyRef* path, uint32 npath, uint32 maxPath,
// Adjust beginning of the buffer to include the visited. // Adjust beginning of the buffer to include the visited.
uint32 req = nvisited - furthestVisited; uint32 req = nvisited - furthestVisited;
uint32 orig = uint32(furthestPath + 1) < npath ? furthestPath + 1 : npath; uint32 orig = uint32(furthestPath + 1) < npath ? furthestPath + 1 : npath;
uint32 size = npath - orig > 0 ? npath - orig : 0; uint32 size = npath > orig ? npath - orig : 0;
if (req + size > maxPath) if (req + size > maxPath)
size = maxPath - req; size = maxPath - req;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "12168" #define REVISION_NR "12169"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__