mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Pools: Fix crash on startup
(cherry picked from commit 9cde3ffd14)
This commit is contained in:
@@ -1360,7 +1360,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
|
||||
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin(); itr != mGameEventPoolIds[internal_event_id].end(); ++itr)
|
||||
{
|
||||
sPoolMgr->DespawnPool(*itr);
|
||||
sPoolMgr->DespawnPool(*itr, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -232,9 +232,9 @@ void PoolGroup<GameObject>::Despawn1Object(uint64 guid, bool alwaysDeleteRespawn
|
||||
|
||||
// Same on one pool
|
||||
template<>
|
||||
void PoolGroup<Pool>::Despawn1Object(uint64 child_pool_id, bool /*alwaysDeleteRespawnTime*/)
|
||||
void PoolGroup<Pool>::Despawn1Object(uint64 child_pool_id, bool alwaysDeleteRespawnTime)
|
||||
{
|
||||
sPoolMgr->DespawnPool(child_pool_id);
|
||||
sPoolMgr->DespawnPool(child_pool_id, alwaysDeleteRespawnTime);
|
||||
}
|
||||
|
||||
// Method for a pool only to remove any found record causing a circular dependency loop
|
||||
@@ -771,22 +771,22 @@ void PoolMgr::SpawnPool(uint32 pool_id)
|
||||
}
|
||||
|
||||
// Call to despawn a pool, all gameobjects/creatures in this pool are removed
|
||||
void PoolMgr::DespawnPool(uint32 pool_id)
|
||||
void PoolMgr::DespawnPool(uint32 pool_id, bool alwaysDeleteRespawnTime)
|
||||
{
|
||||
{
|
||||
auto it = mPoolCreatureGroups.find(pool_id);
|
||||
if (it != mPoolCreatureGroups.end() && !it->second.isEmpty())
|
||||
it->second.DespawnObject(mSpawnedData, 0, true);
|
||||
it->second.DespawnObject(mSpawnedData, 0, alwaysDeleteRespawnTime);
|
||||
}
|
||||
{
|
||||
auto it = mPoolGameobjectGroups.find(pool_id);
|
||||
if (it != mPoolGameobjectGroups.end() && !it->second.isEmpty())
|
||||
it->second.DespawnObject(mSpawnedData, 0, true);
|
||||
it->second.DespawnObject(mSpawnedData, 0, alwaysDeleteRespawnTime);
|
||||
}
|
||||
{
|
||||
auto it = mPoolPoolGroups.find(pool_id);
|
||||
if (it != mPoolPoolGroups.end() && !it->second.isEmpty())
|
||||
it->second.DespawnObject(mSpawnedData);
|
||||
it->second.DespawnObject(mSpawnedData, 0, alwaysDeleteRespawnTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class TC_GAME_API PoolMgr
|
||||
bool CheckPool(uint32 pool_id) const;
|
||||
|
||||
void SpawnPool(uint32 pool_id);
|
||||
void DespawnPool(uint32 pool_id);
|
||||
void DespawnPool(uint32 pool_id, bool alwaysDeleteRespawnTime = false);
|
||||
|
||||
template<typename T>
|
||||
void UpdatePool(uint32 pool_id, uint64 db_guid_or_pool_id);
|
||||
|
||||
Reference in New Issue
Block a user