mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[9575] Use ObjectGuid in Map object stores/world access/search.
This commit is contained in:
parent
b01de55396
commit
a12fecab0d
18 changed files with 131 additions and 126 deletions
|
|
@ -3497,22 +3497,22 @@ void Map::ScriptsProcess()
|
|||
return;
|
||||
}
|
||||
|
||||
Creature* Map::GetCreature(uint64 guid)
|
||||
Creature* Map::GetCreature(ObjectGuid guid)
|
||||
{
|
||||
return m_objectsStore.find<Creature>(guid, (Creature*)NULL);
|
||||
return m_objectsStore.find<Creature>(guid.GetRawValue(), (Creature*)NULL);
|
||||
}
|
||||
|
||||
Vehicle* Map::GetVehicle(uint64 guid)
|
||||
Vehicle* Map::GetVehicle(ObjectGuid guid)
|
||||
{
|
||||
return m_objectsStore.find<Vehicle>(guid, (Vehicle*)NULL);
|
||||
return m_objectsStore.find<Vehicle>(guid.GetRawValue(), (Vehicle*)NULL);
|
||||
}
|
||||
|
||||
Pet* Map::GetPet(uint64 guid)
|
||||
Pet* Map::GetPet(ObjectGuid guid)
|
||||
{
|
||||
return m_objectsStore.find<Pet>(guid, (Pet*)NULL);
|
||||
return m_objectsStore.find<Pet>(guid.GetRawValue(), (Pet*)NULL);
|
||||
}
|
||||
|
||||
Corpse* Map::GetCorpse(uint64 guid)
|
||||
Corpse* Map::GetCorpse(ObjectGuid guid)
|
||||
{
|
||||
Corpse * ret = ObjectAccessor::GetCorpseInMap(guid,GetId());
|
||||
if (!ret)
|
||||
|
|
@ -3522,33 +3522,32 @@ Corpse* Map::GetCorpse(uint64 guid)
|
|||
return ret;
|
||||
}
|
||||
|
||||
Creature* Map::GetCreatureOrPetOrVehicle(uint64 guid)
|
||||
Creature* Map::GetCreatureOrPetOrVehicle(ObjectGuid guid)
|
||||
{
|
||||
if (IS_PLAYER_GUID(guid))
|
||||
return NULL;
|
||||
switch(guid.GetHigh())
|
||||
{
|
||||
case HIGHGUID_UNIT: return GetCreature(guid);
|
||||
case HIGHGUID_PET: return GetPet(guid);
|
||||
case HIGHGUID_VEHICLE: return GetVehicle(guid);
|
||||
default: break;
|
||||
}
|
||||
|
||||
if (IS_PET_GUID(guid))
|
||||
return GetPet(guid);
|
||||
|
||||
if (IS_VEHICLE_GUID(guid))
|
||||
return GetVehicle(guid);
|
||||
|
||||
return GetCreature(guid);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GameObject* Map::GetGameObject(uint64 guid)
|
||||
GameObject* Map::GetGameObject(ObjectGuid guid)
|
||||
{
|
||||
return m_objectsStore.find<GameObject>(guid, (GameObject*)NULL);
|
||||
return m_objectsStore.find<GameObject>(guid.GetRawValue(), (GameObject*)NULL);
|
||||
}
|
||||
|
||||
DynamicObject* Map::GetDynamicObject(uint64 guid)
|
||||
DynamicObject* Map::GetDynamicObject(ObjectGuid guid)
|
||||
{
|
||||
return m_objectsStore.find<DynamicObject>(guid, (DynamicObject*)NULL);
|
||||
return m_objectsStore.find<DynamicObject>(guid.GetRawValue(), (DynamicObject*)NULL);
|
||||
}
|
||||
|
||||
WorldObject* Map::GetWorldObject(uint64 guid)
|
||||
WorldObject* Map::GetWorldObject(ObjectGuid guid)
|
||||
{
|
||||
switch(GUID_HIPART(guid))
|
||||
switch(guid.GetHigh())
|
||||
{
|
||||
case HIGHGUID_PLAYER: return ObjectAccessor::FindPlayer(guid);
|
||||
case HIGHGUID_GAMEOBJECT: return GetGameObject(guid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue