feat(Core): Config to disable all Wintergrasp processing (#13086)

* feat(Core): Config to disable all Wintergrasp processing

* Use 2 instead of -1 - configs are parsed as uint

* Fix build warnings
This commit is contained in:
ZhengPeiRu21
2022-11-01 03:22:09 -06:00
committed by GitHub
parent 9e89917fd7
commit 5a7822282f
8 changed files with 15 additions and 8 deletions
@@ -40,6 +40,12 @@ BattlefieldMgr* BattlefieldMgr::instance()
void BattlefieldMgr::InitBattlefield()
{
if (sWorld->getIntConfig(CONFIG_WINTERGRASP_ENABLE) == 2)
{
LOG_INFO("server.loading", "Battlefield: Wintergrasp is disabled.");
LOG_INFO("server.loading", " ");
return;
}
Battlefield* pBf = new BattlefieldWG;
// respawn, init variables
if (!pBf->SetupBattlefield())
@@ -50,7 +50,7 @@ bool BattlefieldWG::SetupBattlefield()
InitStalker(BATTLEFIELD_WG_NPC_STALKER, WintergraspStalkerPos[0], WintergraspStalkerPos[1], WintergraspStalkerPos[2], WintergraspStalkerPos[3]);
m_MaxPlayer = sWorld->getIntConfig(CONFIG_WINTERGRASP_PLR_MAX);
m_IsEnabled = sWorld->getBoolConfig(CONFIG_WINTERGRASP_ENABLE);
m_IsEnabled = sWorld->getIntConfig(CONFIG_WINTERGRASP_ENABLE) == 1;
m_MinPlayer = sWorld->getIntConfig(CONFIG_WINTERGRASP_PLR_MIN);
m_MinLevel = sWorld->getIntConfig(CONFIG_WINTERGRASP_PLR_MIN_LVL);
m_BattleTime = sWorld->getIntConfig(CONFIG_WINTERGRASP_BATTLETIME) * MINUTE * IN_MILLISECONDS;