mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +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
|
|
@ -1241,17 +1241,10 @@ bool Creature::LoadFromDB(uint32 guidlow, Map *map)
|
|||
GameEventCreatureData const* eventData = sGameEventMgr.GetCreatureUpdateDataForActiveEvent(guidlow);
|
||||
|
||||
m_DBTableGuid = guidlow;
|
||||
if (map->GetInstanceId() == 0)
|
||||
{
|
||||
// Creature can be loaded already in map if grid has been unloaded while creature walk to another grid
|
||||
// FIXME: until creature guids is global and for instances used dynamic generated guids
|
||||
// in instance possible load creature duplicates with same DB guid but different in game guids
|
||||
// This will be until implementing per-map creature guids
|
||||
if (map->GetCreature(ObjectGuid(HIGHGUID_UNIT, data->id, guidlow)))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
guidlow = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT);
|
||||
|
||||
// Creature can be loaded already in map if grid has been unloaded while creature walk to another grid
|
||||
if (map->GetCreature(ObjectGuid(HIGHGUID_UNIT, data->id, guidlow)))
|
||||
return false;
|
||||
|
||||
if (!Create(guidlow, map, data->phaseMask, data->id, TEAM_NONE, data, eventData))
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue