mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[8042] Speedup search creature/pet/vehicle by guid.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
3e2b810376
commit
fe88960e09
2 changed files with 8 additions and 5 deletions
|
|
@ -49,11 +49,14 @@ ObjectAccessor::~ObjectAccessor() {}
|
|||
Creature*
|
||||
ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const &u, uint64 guid)
|
||||
{
|
||||
if(Creature *unit = GetPet(guid))
|
||||
return unit;
|
||||
if(IS_PLAYER_GUID(guid))
|
||||
return NULL;
|
||||
|
||||
if(Creature *unit = GetVehicle(guid))
|
||||
return unit;
|
||||
if(IS_PET_GUID(guid))
|
||||
return GetPet(guid);
|
||||
|
||||
if(IS_VEHICLE_GUID(guid))
|
||||
return GetVehicle(guid);
|
||||
|
||||
return u.GetMap()->GetCreature(guid);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue