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