Core/Pools: Fix crash on startup
Port From (https://github.com/TrinityCore/TrinityCore/commit/7eff81f9dbf93e6f1efbd77b2623a0ee881f82cf)
This commit is contained in:
@@ -1312,7 +1312,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (var poolId in mGameEventPoolIds[internal_event_id])
|
foreach (var poolId in mGameEventPoolIds[internal_event_id])
|
||||||
Global.PoolMgr.DespawnPool(poolId);
|
Global.PoolMgr.DespawnPool(poolId, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeEquipOrModel(short event_id, bool activate)
|
void ChangeEquipOrModel(short event_id, bool activate)
|
||||||
|
|||||||
@@ -325,16 +325,16 @@ namespace Game
|
|||||||
SpawnPool<Creature>(pool_id, 0);
|
SpawnPool<Creature>(pool_id, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DespawnPool(uint pool_id)
|
public void DespawnPool(uint pool_id, bool alwaysDeleteRespawnTime = false)
|
||||||
{
|
{
|
||||||
if (mPoolCreatureGroups.ContainsKey(pool_id) && !mPoolCreatureGroups[pool_id].IsEmpty())
|
if (mPoolCreatureGroups.ContainsKey(pool_id) && !mPoolCreatureGroups[pool_id].IsEmpty())
|
||||||
mPoolCreatureGroups[pool_id].DespawnObject(mSpawnedData, 0, true);
|
mPoolCreatureGroups[pool_id].DespawnObject(mSpawnedData, 0, alwaysDeleteRespawnTime);
|
||||||
|
|
||||||
if (mPoolGameobjectGroups.ContainsKey(pool_id) && !mPoolGameobjectGroups[pool_id].IsEmpty())
|
if (mPoolGameobjectGroups.ContainsKey(pool_id) && !mPoolGameobjectGroups[pool_id].IsEmpty())
|
||||||
mPoolGameobjectGroups[pool_id].DespawnObject(mSpawnedData, 0, true);
|
mPoolGameobjectGroups[pool_id].DespawnObject(mSpawnedData, 0, alwaysDeleteRespawnTime);
|
||||||
|
|
||||||
if (mPoolPoolGroups.ContainsKey(pool_id) && !mPoolPoolGroups[pool_id].IsEmpty())
|
if (mPoolPoolGroups.ContainsKey(pool_id) && !mPoolPoolGroups[pool_id].IsEmpty())
|
||||||
mPoolPoolGroups[pool_id].DespawnObject(mSpawnedData);
|
mPoolPoolGroups[pool_id].DespawnObject(mSpawnedData, 0, alwaysDeleteRespawnTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CheckPool(uint pool_id)
|
public bool CheckPool(uint pool_id)
|
||||||
@@ -532,7 +532,7 @@ namespace Game
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "Pool":
|
case "Pool":
|
||||||
Global.PoolMgr.DespawnPool((uint)guid);
|
Global.PoolMgr.DespawnPool((uint)guid, alwaysDeleteRespawnTime);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user