aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Scripting
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-07-18 22:45:03 +0200
committerShauren <shauren.trinity@gmail.com>2022-07-18 22:45:03 +0200
commit775be0682a794d0a1f62d656f8c6c6dffca8de79 (patch)
tree088bbc4b6aef8953d5b6d186d0d06dd2cef2469e /src/server/game/Scripting
parent21ae3766928641c7af24cd96544fc5b115461e82 (diff)
Core/OutdoorPvP: Refactor OutdoorPvP creation to be linked to host map creation instead of having globally accessible objects
Diffstat (limited to 'src/server/game/Scripting')
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp4
-rw-r--r--src/server/game/Scripting/ScriptMgr.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index c911afdad87..4cf0c6c3eea 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -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()
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index e5fd8bee5b9..d729a0309f0 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -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 */