Player* ObjectAccessor::FindPlayer(uint64 guid) { Player* plr = GetObjectInWorld(guid, (Player*)NULL); if (!plr || !plr->IsInWorld()) return NULL; return plr; }
Corpse* ObjectAccessor::GetCorpse(WorldObject const &u, uint64 guid) { Corpse * ret = GetObjectInWorld(guid, (Corpse*)NULL); if(!ret) return NULL; if(ret->GetMapId() != u.GetMapId()) return NULL; if(ret->GetInstanceId() != u.GetInstanceId()) return NULL; return ret; }
DynamicObject* ObjectAccessor::GetDynamicObject(WorldObject const &u, uint64 guid) { DynamicObject * ret = GetObjectInWorld(guid, (DynamicObject*)NULL); if(!ret) return NULL; if(ret->GetMapId() != u.GetMapId()) return NULL; if(ret->GetInstanceId() != u.GetInstanceId()) return NULL; return ret; }
Unit* ObjectAccessor::FindUnit(uint64 guid) { return GetObjectInWorld(guid, (Unit*)NULL); }
Player* ObjectAccessor::FindPlayer(uint64 guid) { return GetObjectInWorld(guid, (Player*)NULL); }
DynamicObject* ObjectAccessor::FindDynamicObject(uint64 guid) { return GetObjectInWorld(guid, (DynamicObject*)NULL); }
Creature* ObjectAccessor::FindCreature(uint64 guid) { return GetObjectInWorld(guid, (Creature*)NULL); }
Pet* ObjectAccessor::GetPet(uint64 guid) { return GetObjectInWorld(guid, (Pet*)NULL); }
Vehicle* ObjectAccessor::GetVehicle(uint64 guid) { return GetObjectInWorld(guid, (Vehicle*)NULL); }
Pet* ObjectAccessor::FindPet(ObjectGuid guid) { return GetObjectInWorld(guid, (Pet*)NULL); }