mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8041"
|
||||
#define REVISION_NR "8042"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue