mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[7159] Allow GO cast as need (use go coordinates for target select in some cases)
Fixed work all Huter traps target selection More check in ObjectAccessor::Get Object More generic work 22 TARGET_CASTER_COORDINATES target type Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
c2a0a18a38
commit
abaa111eaa
10 changed files with 71 additions and 42 deletions
|
|
@ -171,11 +171,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;
|
||||
|
||||
|
|
@ -203,9 +208,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;
|
||||
}
|
||||
|
||||
|
|
@ -216,15 +221,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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue