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

@@ -1750,10 +1750,10 @@ Battleground* ScriptMgr::CreateBattleground(BattlegroundTypeId /*typeId*/)
return nullptr;
}
OutdoorPvP* ScriptMgr::CreateOutdoorPvP(uint32 scriptId)
OutdoorPvP* ScriptMgr::CreateOutdoorPvP(uint32 scriptId, Map* map)
{
GET_SCRIPT_RET(OutdoorPvPScript, scriptId, tmpscript, nullptr);
return tmpscript->GetOutdoorPvP();
return tmpscript->GetOutdoorPvP(map);
}
Trinity::ChatCommands::ChatCommandTable ScriptMgr::GetChatCommands()

View File

@@ -550,7 +550,7 @@ class TC_GAME_API OutdoorPvPScript : public ScriptObject
~OutdoorPvPScript();
// Should return a fully valid OutdoorPvP object for the type ID.
virtual OutdoorPvP* GetOutdoorPvP() const = 0;
virtual OutdoorPvP* GetOutdoorPvP(Map* map) const = 0;
};
class TC_GAME_API CommandScript : public ScriptObject
@@ -1154,7 +1154,7 @@ class TC_GAME_API ScriptMgr
public: /* OutdoorPvPScript */
OutdoorPvP* CreateOutdoorPvP(uint32 scriptId);
OutdoorPvP* CreateOutdoorPvP(uint32 scriptId, Map* map);
public: /* CommandScript */