mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +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
|
|
@ -203,7 +203,7 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode, Map* _par
|
|||
m_activeNonPlayersIter(m_activeNonPlayers.end()),
|
||||
i_gridExpiry(expiry), m_parentMap(_parent ? _parent : this),
|
||||
m_VisibleDistance(DEFAULT_VISIBILITY_DISTANCE),
|
||||
m_hiDynObjectGuid(1)
|
||||
m_hiDynObjectGuid(1), m_hiVehicleGuid(1)
|
||||
{
|
||||
for(unsigned int idx=0; idx < MAX_NUMBER_OF_GRIDS; ++idx)
|
||||
{
|
||||
|
|
@ -3425,12 +3425,18 @@ Pet* Map::GetPet(uint64 guid)
|
|||
return m_objectsStore.find<Pet>(guid, (Pet*)NULL);
|
||||
}
|
||||
|
||||
Unit* Map::GetCreatureOrPet(uint64 guid)
|
||||
Creature* Map::GetCreatureOrPetOrVehicle(uint64 guid)
|
||||
{
|
||||
if (Unit* ret = GetCreature(guid))
|
||||
return ret;
|
||||
if (IS_PLAYER_GUID(guid))
|
||||
return NULL;
|
||||
|
||||
return GetPet(guid);
|
||||
if (IS_PET_GUID(guid))
|
||||
return GetPet(guid);
|
||||
|
||||
if (IS_VEHICLE_GUID(guid))
|
||||
return GetVehicle(guid);
|
||||
|
||||
return GetCreature(guid);
|
||||
}
|
||||
|
||||
GameObject* Map::GetGameObject(uint64 guid)
|
||||
|
|
@ -3477,6 +3483,13 @@ uint32 Map::GenerateLocalLowGuid(HighGuid guidhigh)
|
|||
World::StopNow(ERROR_EXIT_CODE);
|
||||
}
|
||||
return m_hiDynObjectGuid++;
|
||||
case HIGHGUID_VEHICLE:
|
||||
if(m_hiVehicleGuid>=0x00FFFFFF)
|
||||
{
|
||||
sLog.outError("Vehicle guid overflow!! Can't continue, shutting down server. ");
|
||||
World::StopNow(ERROR_EXIT_CODE);
|
||||
}
|
||||
return m_hiVehicleGuid++;
|
||||
default:
|
||||
ASSERT(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue