Core/Battlefields: Refactor Battlefield creation to be linked to host map creation instead of having globally accessible objects

This commit is contained in:
Shauren authored and Ovahlord committed 2022-12-26 13:24:59 +01:00
1 parent 28ad85c160
commit 265c2fa508
22 files changed
+253 -192

No files matched your search

+8
View File
@@ -16,6 +16,7 @@
*/
#include "Map.h"
#include "BattlefieldMgr.h"
#include "Battleground.h"
#include "CellImpl.h"
#include "DatabaseEnv.h"
@@ -39,6 +40,7 @@
#include "ObjectAccessor.h"
#include "ObjectGridLoader.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
#include "Pet.h"
#include "PoolMgr.h"
#include "PhasingHandler.h"
@@ -90,6 +92,9 @@ Map::~Map()
if (!m_scriptSchedule.empty())
sMapMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size());
sOutdoorPvPMgr->DestroyOutdoorPvPForMap(this);
sBattlefieldMgr->DestroyBattlefieldsForMap(this);
MMAP::MMapFactory::createOrGetMMapManager()->unloadMapInstance(GetId(), i_InstanceId);
}
@@ -147,6 +152,9 @@ i_scriptLock(false), _respawnCheckTimer(0)
_worldStateValues = sWorldStateMgr->GetInitialWorldStatesForMap(this);
sOutdoorPvPMgr->CreateOutdoorPvPForMap(this);
sBattlefieldMgr->CreateBattlefieldsForMap(this);
sScriptMgr->OnCreateMap(this);
}