mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[11139] Use for Creature/GameObject local per-map guids
* Creature/GameObject guid generators moved to Map * For avoid wrong not converted cases generic function in ObjectMgr has been replaced by specilized guid generation function like sObjectMgr.GeneratePlayerLowGuid(). This let catch all cases that need update in custom code or scripts. * Drop many ObjectAcessor.h now dead code. This is also make mangos more thread safe. * Restore one more time unix build broken in prev. commits. Note: many cases when something not wotk in instance but work in continents possible magicly start work after this commit. For example, some gm commands. From large systems that need more chnages for start work in full power in instances can be referecned pool/gamevent system. Last need just small hacks drop changes but in will addded in independent commit.
This commit is contained in:
parent
9a8a74c2ad
commit
cf685da47a
29 changed files with 69 additions and 138 deletions
|
|
@ -40,7 +40,6 @@
|
|||
|
||||
Map::~Map()
|
||||
{
|
||||
ObjectAccessor::DelinkMap(this);
|
||||
UnloadAll(true);
|
||||
|
||||
if(!m_scriptSchedule.empty())
|
||||
|
|
@ -78,6 +77,9 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode)
|
|||
i_gridExpiry(expiry), m_TerrainData(sTerrainMgr.LoadTerrain(id)),
|
||||
i_data(NULL), i_script_id(0)
|
||||
{
|
||||
m_CreatureGuids.Set(sObjectMgr.GetFirstCreatureLowGuid());
|
||||
m_GameObjectGuids.Set(sObjectMgr.GetFirstGameObjectLowGuid());
|
||||
|
||||
for(unsigned int j=0; j < MAX_NUMBER_OF_GRIDS; ++j)
|
||||
{
|
||||
for(unsigned int idx=0; idx < MAX_NUMBER_OF_GRIDS; ++idx)
|
||||
|
|
@ -87,7 +89,6 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode)
|
|||
setNGrid(NULL, idx, j);
|
||||
}
|
||||
}
|
||||
ObjectAccessor::LinkMap(this);
|
||||
|
||||
//lets initialize visibility distance for map
|
||||
Map::InitVisibilityDistance();
|
||||
|
|
@ -3027,6 +3028,10 @@ uint32 Map::GenerateLocalLowGuid(HighGuid guidhigh)
|
|||
// TODO: for map local guid counters possible force reload map instead shutdown server at guid counter overflow
|
||||
switch(guidhigh)
|
||||
{
|
||||
case HIGHGUID_UNIT:
|
||||
return m_CreatureGuids.Generate();
|
||||
case HIGHGUID_GAMEOBJECT:
|
||||
return m_GameObjectGuids.Generate();
|
||||
case HIGHGUID_DYNAMICOBJECT:
|
||||
return m_DynObjectGuids.Generate();
|
||||
case HIGHGUID_PET:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue