mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +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*
|
Creature*
|
||||||
ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const &u, uint64 guid)
|
ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const &u, uint64 guid)
|
||||||
{
|
{
|
||||||
if(Creature *unit = GetPet(guid))
|
if(IS_PLAYER_GUID(guid))
|
||||||
return unit;
|
return NULL;
|
||||||
|
|
||||||
if(Creature *unit = GetVehicle(guid))
|
if(IS_PET_GUID(guid))
|
||||||
return unit;
|
return GetPet(guid);
|
||||||
|
|
||||||
|
if(IS_VEHICLE_GUID(guid))
|
||||||
|
return GetVehicle(guid);
|
||||||
|
|
||||||
return u.GetMap()->GetCreature(guid);
|
return u.GetMap()->GetCreature(guid);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8041"
|
#define REVISION_NR "8042"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue