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

This commit is contained in:
Shauren
2022-07-18 22:45:03 +02:00
parent 21ae376692
commit 775be0682a
19 changed files with 94 additions and 112 deletions

View File

@@ -43,6 +43,7 @@
#include "ObjectAccessor.h"
#include "ObjectGridLoader.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
#include "Pet.h"
#include "PhasingHandler.h"
#include "PoolMgr.h"
@@ -94,6 +95,8 @@ Map::~Map()
if (!m_scriptSchedule.empty())
sMapMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size());
sOutdoorPvPMgr->DestroyOutdoorPvPForMap(this);
if (m_parentMap == this)
delete m_childTerrainMaps;
@@ -375,6 +378,8 @@ i_scriptLock(false), _respawnCheckTimer(0)
_worldStateValues = sWorldStateMgr->GetInitialWorldStatesForMap(this);
sOutdoorPvPMgr->CreateOutdoorPvPForMap(this);
sScriptMgr->OnCreateMap(this);
}