[6835] Check instanceid at search creature by guid.

This commit is contained in:
VladimirMangos 2008-11-17 14:55:37 +03:00
parent 5439dd0fd4
commit 2a3c3195b7
2 changed files with 10 additions and 2 deletions

View file

@ -140,7 +140,15 @@ Creature*
ObjectAccessor::GetCreature(WorldObject const &u, uint64 guid)
{
Creature * ret = GetObjectInWorld(guid, (Creature*)NULL);
if(ret && ret->GetMapId() != u.GetMapId()) ret = NULL;
if(!ret)
return NULL;
if(ret->GetMapId() != u.GetMapId())
return NULL;
if(ret->GetInstanceId() != u.GetInstanceId())
return NULL;
return ret;
}