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

This commit is contained in:
Shauren
2022-07-19 23:18:19 +02:00
parent 83b3266794
commit 073a036d84
21 changed files with 160 additions and 114 deletions

View File

@@ -1737,10 +1737,10 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger, b
return entered ? tmpscript->OnTrigger(player, trigger) : tmpscript->OnExit(player, trigger);
}
Battlefield* ScriptMgr::CreateBattlefield(uint32 scriptId)
Battlefield* ScriptMgr::CreateBattlefield(uint32 scriptId, Map* map)
{
GET_SCRIPT_RET(BattlefieldScript, scriptId, tmpscript, nullptr);
return tmpscript->GetBattlefield();
return tmpscript->GetBattlefield(map);
}
Battleground* ScriptMgr::CreateBattleground(BattlegroundTypeId /*typeId*/)