mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
*Update to Mangos 7183.
--HG-- branch : trunk
This commit is contained in:
@@ -173,11 +173,16 @@ Corpse*
|
||||
ObjectAccessor::GetCorpse(WorldObject const &u, uint64 guid)
|
||||
{
|
||||
Corpse * ret = GetObjectInWorld(guid, (Corpse*)NULL);
|
||||
if(ret && ret->GetMapId() != u.GetMapId()) ret = NULL;
|
||||
if(!ret)
|
||||
return NULL;
|
||||
if(ret->GetMapId() != u.GetMapId())
|
||||
ret = NULL;
|
||||
if(ret->GetInstanceId() != u.GetInstanceId())
|
||||
return NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Object* ObjectAccessor::GetObjectByTypeMask(Player const &p, uint64 guid, uint32 typemask)
|
||||
Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const &p, uint64 guid, uint32 typemask)
|
||||
{
|
||||
Object *obj = NULL;
|
||||
|
||||
@@ -205,9 +210,9 @@ Object* ObjectAccessor::GetObjectByTypeMask(Player const &p, uint64 guid, uint32
|
||||
if(obj) return obj;
|
||||
}
|
||||
|
||||
if(typemask & TYPEMASK_ITEM)
|
||||
if(typemask & TYPEMASK_ITEM && p.GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
obj = p.GetItemByGuid( guid );
|
||||
obj = ((Player const &)p).GetItemByGuid( guid );
|
||||
if(obj) return obj;
|
||||
}
|
||||
|
||||
@@ -218,15 +223,25 @@ GameObject*
|
||||
ObjectAccessor::GetGameObject(WorldObject const &u, uint64 guid)
|
||||
{
|
||||
GameObject * ret = GetObjectInWorld(guid, (GameObject*)NULL);
|
||||
if(ret && ret->GetMapId() != u.GetMapId()) ret = NULL;
|
||||
if(!ret)
|
||||
return NULL;
|
||||
if(ret->GetMapId() != u.GetMapId())
|
||||
ret = NULL;
|
||||
if(ret->GetInstanceId() != u.GetInstanceId())
|
||||
return NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
DynamicObject*
|
||||
ObjectAccessor::GetDynamicObject(Unit const &u, uint64 guid)
|
||||
ObjectAccessor::GetDynamicObject(WorldObject const &u, uint64 guid)
|
||||
{
|
||||
DynamicObject * ret = GetObjectInWorld(guid, (DynamicObject*)NULL);
|
||||
if(ret && ret->GetMapId() != u.GetMapId()) ret = NULL;
|
||||
if(!ret)
|
||||
return NULL;
|
||||
if(ret->GetMapId() != u.GetMapId())
|
||||
ret = NULL;
|
||||
if(ret->GetInstanceId() != u.GetInstanceId())
|
||||
return NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user