aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorSebastian Valle <s.v.h21@hotmail.com>2013-09-03 15:09:37 -0500
committerSebastian Valle <s.v.h21@hotmail.com>2013-09-03 15:09:37 -0500
commit24f8b2b994bb22f460bf304936cfc8a57e1c1220 (patch)
tree178cf58b337bb9c34dce277424ba090137dc30a3 /src/server
parent5b95301de51e7706ce07a5f2c185ab32decc23f7 (diff)
Core/Misc: Fixed some more issues found by code analysis tools.
Diffstat (limited to 'src/server')
-rw-r--r--src/server/game/AI/CreatureAI.cpp2
-rw-r--r--src/server/game/Maps/Map.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp2
3 files changed, 6 insertions, 5 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index cbb79b47958..75a1488ed45 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -75,6 +75,8 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
}
}
+ // Intended duplicated check, the code above this should select a victim
+ // If it can't find a suitable attack target then we should error out.
if (!creature->HasReactState(REACT_PASSIVE) && !creature->GetVictim())
{
TC_LOG_ERROR(LOG_FILTER_GENERAL, "DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry());
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 27f97ba93d4..04c2c22c595 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -2407,6 +2407,8 @@ bool InstanceMap::AddPlayerToMap(Player* player)
mapSave = sInstanceSaveMgr->AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true);
}
+ ASSERT(mapSave);
+
// check for existing instance binds
InstancePlayerBind* playerBind = player->GetBoundInstance(GetId(), Difficulty(GetSpawnMode()));
if (playerBind && playerBind->perm)
@@ -2441,10 +2443,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
if (groupBind->save != mapSave)
{
TC_LOG_ERROR(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d but he is in group %d which is bound to instance %d, %d, %d!", player->GetName().c_str(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(group->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty());
- if (mapSave)
- TC_LOG_ERROR(LOG_FILTER_MAPS, "MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
- else
- TC_LOG_ERROR(LOG_FILTER_MAPS, "MapSave NULL");
+ TC_LOG_ERROR(LOG_FILTER_MAPS, "MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
if (groupBind->save)
TC_LOG_ERROR(LOG_FILTER_MAPS, "GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount());
else
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
index a1f33e57907..1b5a42a83ef 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
@@ -79,7 +79,7 @@ public:
if (Creature* pBalinda = Unit::GetCreature(*me, balindaGUID))
if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50)
EnterEvadeMode();
- resetTimer = 5 * IN_MILLISECONDS;
+ resetTimer = 5 * IN_MILLISECONDS;
} else resetTimer -= diff;
DoMeleeAttackIfReady();