mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[11168] Use MapPersistentState for access to Pool System dynamic data.
* Direct store pool system dynamic data in sPoolMgr replaced by shared pool system data object (for all non instanceable maps) into WorldPersistentState, and own copies of pool system data object in DungeonPersistentState/BattlegroundPersistentState. This let have pools with object at many non-instanceable maps, and single map pools with unique state for each instance. * Avoid direct global grid data modify from pool system, and use for this also recently added local for MapPersistentState grid spawn data. * Implemented proper API for update pool system data in MapPersistentStates from GameEvent system. * Initialize pool system state at MapPersistendState creating. For shared pool system state for non-instanceable maps initilized at first map state creating. Now pool system propertly work in instance also!
This commit is contained in:
parent
9e14a0529d
commit
8feaf211f1
14 changed files with 299 additions and 185 deletions
|
|
@ -497,7 +497,7 @@ void Creature::Update(uint32 update_diff, uint32 diff)
|
|||
{
|
||||
// since pool system can fail to roll unspawned object, this one can remain spawned, so must set respawn nevertheless
|
||||
if (uint16 poolid = sPoolMgr.IsPartOfAPool<Creature>(GetGUIDLow()))
|
||||
sPoolMgr.UpdatePool<Creature>(poolid, GetGUIDLow());
|
||||
sPoolMgr.UpdatePool<Creature>(*GetMap()->GetPersistentState(), poolid, GetGUIDLow());
|
||||
|
||||
if (IsInWorld()) // can be despawned by update pool
|
||||
{
|
||||
|
|
@ -527,7 +527,7 @@ void Creature::Update(uint32 update_diff, uint32 diff)
|
|||
{
|
||||
// since pool system can fail to roll unspawned object, this one can remain spawned, so must set respawn nevertheless
|
||||
if (uint16 poolid = sPoolMgr.IsPartOfAPool<Creature>(GetGUIDLow()))
|
||||
sPoolMgr.UpdatePool<Creature>(poolid, GetGUIDLow());
|
||||
sPoolMgr.UpdatePool<Creature>(*GetMap()->GetPersistentState(), poolid, GetGUIDLow());
|
||||
|
||||
if (IsInWorld()) // can be despawned by update pool
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue