diff options
-rw-r--r-- | src/game/Object.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game/Object.h b/src/game/Object.h index 20907fc9d12..9c073219d7b 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -560,9 +560,10 @@ class WorldObject : public Object, public WorldLocation bool IsInMap(const WorldObject* obj) const { - if (!obj || !IsInWorld() || !(obj->IsInWorld()) || GetMap() != obj->GetMap() || !InSamePhase(obj)) - return false; - return true; + if (obj)
+ return IsInWorld() && obj->IsInWorld() && (GetMap() == obj->GetMap()) && InSamePhase(obj);
+ else
+ return false;
} bool IsWithinDist3d(float x, float y, float z, float dist) const { return IsInDist(x, y, z, dist + GetObjectSize()); } |