mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[8710] Make vehicle guid counter per-map local.
Also update/drop/move to Map some dependent functions.
This commit is contained in:
parent
53b6d28a24
commit
b942616ded
15 changed files with 46 additions and 69 deletions
|
|
@ -50,21 +50,6 @@ ObjectAccessor::~ObjectAccessor()
|
|||
delete itr->second;
|
||||
}
|
||||
|
||||
Creature*
|
||||
ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const &u, uint64 guid)
|
||||
{
|
||||
if(IS_PLAYER_GUID(guid) || !u.IsInWorld())
|
||||
return NULL;
|
||||
|
||||
if(IS_PET_GUID(guid))
|
||||
return u.GetMap()->GetPet(guid);
|
||||
|
||||
if(IS_VEHICLE_GUID(guid))
|
||||
return u.GetMap()->GetVehicle(guid);
|
||||
|
||||
return u.GetMap()->GetCreature(guid);
|
||||
}
|
||||
|
||||
Unit*
|
||||
ObjectAccessor::GetUnit(WorldObject const &u, uint64 guid)
|
||||
{
|
||||
|
|
@ -74,7 +59,10 @@ ObjectAccessor::GetUnit(WorldObject const &u, uint64 guid)
|
|||
if(IS_PLAYER_GUID(guid))
|
||||
return FindPlayer(guid);
|
||||
|
||||
return GetCreatureOrPetOrVehicle(u, guid);
|
||||
if (!u.IsInWorld())
|
||||
return NULL;
|
||||
|
||||
return u.GetMap()->GetCreatureOrPetOrVehicle(guid);
|
||||
}
|
||||
|
||||
Corpse*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue