[6977] Fixed a crash caused by incorrect use of GetMap for corpses in other maps, and another one caused by SelectHostilTarget failing to notice the target is not in world, due to a fauly InSameMap check.

This commit is contained in:
Wyk3d 2008-12-29 21:16:12 +02:00
parent 75b1db8cd0
commit 07394d45da
3 changed files with 3 additions and 3 deletions

View file

@ -416,7 +416,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object
float GetDistance2d(const WorldObject* obj) const;
float GetDistance2d(const float x, const float y) const;
float GetDistanceZ(const WorldObject* obj) const;
bool IsInMap(const WorldObject* obj) const { return GetMapId()==obj->GetMapId() && GetInstanceId()==obj->GetInstanceId(); }
bool IsInMap(const WorldObject* obj) const { return IsInWorld() && obj->IsInWorld() && GetMapId()==obj->GetMapId() && GetInstanceId()==obj->GetInstanceId(); }
bool IsWithinDistInMap(const WorldObject* obj, const float dist2compare, const bool is3D = true) const;
bool IsWithinLOS(const float x, const float y, const float z ) const;
bool IsWithinLOSInMap(const WorldObject* obj) const;