Fix Object::IsInMap to check instanceId.

Fig group loot distance checks to also check map instanceId.
Fixes issue #1172.

--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-03-19 22:28:00 +01:00
parent b6258cf1cf
commit 7a8dff70ed
2 changed files with 13 additions and 10 deletions
+6 -3
View File
@@ -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()); }