mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Core/Battlegrounds: Unload all grids before destroying battleground object
Closes #28755
This commit is contained in:
@@ -134,7 +134,9 @@ Battleground::~Battleground()
|
||||
// unload map
|
||||
if (m_Map)
|
||||
{
|
||||
m_Map->SetUnload();
|
||||
m_Map->UnloadAll(); // unload all objects (they may hold a reference to bg in their ZoneScript pointer)
|
||||
m_Map->SetUnload(); // mark for deletion by MapManager
|
||||
|
||||
//unlink to prevent crash, always unlink all pointer reference before destruction
|
||||
m_Map->SetBG(nullptr);
|
||||
m_Map = nullptr;
|
||||
|
||||
@@ -244,7 +244,7 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
|
||||
bool UnloadGrid(NGridType& ngrid, bool pForce);
|
||||
void GridMarkNoUnload(uint32 x, uint32 y);
|
||||
void GridUnmarkNoUnload(uint32 x, uint32 y);
|
||||
virtual void UnloadAll();
|
||||
void UnloadAll();
|
||||
|
||||
void ResetGridExpiry(NGridType &grid, float factor = 1) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user