aboutsummaryrefslogtreecommitdiff
path: root/src/game/Object.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Object.h')
-rw-r--r--src/game/Object.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/Object.h b/src/game/Object.h
index 9845ba10dce..efc5e8c18d2 100644
--- a/src/game/Object.h
+++ b/src/game/Object.h
@@ -518,7 +518,10 @@ class TRINITY_DLL_SPEC WorldObject : public Object, public WorldLocation
bool IsInMap(const WorldObject* obj) const
{
- return IsInWorld() && obj->IsInWorld() && (GetMap() == obj->GetMap()) && InSamePhase(obj);
+ 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()); }