aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/Map.cpp
diff options
context:
space:
mode:
authorSpp <none@none>2010-08-21 21:54:41 +0200
committerSpp <none@none>2010-08-21 21:54:41 +0200
commita136403deed39dc7d8523fc7117a070b238992f9 (patch)
tree393e0b5d1f40ccb24c622c429787628ffbdcc00d /src/server/game/Maps/Map.cpp
parentc15c605a114179a8b39500b5ef1717c791f60d4f (diff)
Core: Remove "suggest parentheses around ‘&&’ within ‘||’" and "suggest parentheses around assignment used as truth value" warnings
--HG-- branch : trunk
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r--src/server/game/Maps/Map.cpp43
1 files changed, 24 insertions, 19 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 8b955782b7f..9c4b4f80a56 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -1719,7 +1719,8 @@ uint16 Map::GetAreaFlag(float x, float y, float z, bool *isOutdoors) const
if (GetAreaInfo(x, y, z, mogpFlags, adtId, rootId, groupId))
{
haveAreaInfo = true;
- if (wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId))
+ wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId);
+ if (wmoEntry)
atEntry = GetAreaEntryByAreaID(wmoEntry->areaId);
}
@@ -3233,8 +3234,8 @@ void Map::ScriptsProcess()
// when script called for item spell casting then target == (unit or GO) and source is player
WorldObject* worldObject;
- Player* pTarget = NULL;
- if (pTarget = target->ToPlayer())
+ Player* pTarget = target->ToPlayer();
+ if (pTarget)
{
if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER)
{
@@ -3244,23 +3245,27 @@ void Map::ScriptsProcess()
}
worldObject = dynamic_cast<WorldObject*>(source);
}
- else if (pTarget = source->ToPlayer())
+ else
{
- if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER)
- {
- sLog.outError("%s target is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
- step.script->GetDebugInfo().c_str(), target->GetTypeId(), target->GetEntry(), target->GetGUIDLow());
- break;
- }
- worldObject = dynamic_cast<WorldObject*>(target);
- }
- else
- {
- sLog.outError("%s neither source nor target is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
- step.script->GetDebugInfo().c_str(),
- source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
- target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
- break;
+ pTarget = source->ToPlayer();
+ if (pTarget)
+ {
+ if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER)
+ {
+ sLog.outError("%s target is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ step.script->GetDebugInfo().c_str(), target->GetTypeId(), target->GetEntry(), target->GetGUIDLow());
+ break;
+ }
+ worldObject = dynamic_cast<WorldObject*>(target);
+ }
+ else
+ {
+ sLog.outError("%s neither source nor target is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ step.script->GetDebugInfo().c_str(),
+ source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
+ target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
+ break;
+ }
}
// quest id and flags checked at script loading