diff options
| author | Shauren <shauren.trinity@gmail.com> | 2022-07-19 23:18:19 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-07-19 23:18:19 +0200 |
| commit | 073a036d84365dae60a70064eb67e68f0447bd72 (patch) | |
| tree | b9c74a852d8135c26e3d952e26ade11155c65f29 /src/server/scripts/Commands | |
| parent | 83b32667940844a257059965711284c9ab38ce44 (diff) | |
Core/Battlefields: Refactor Battlefield creation to be linked to host map creation instead of having globally accessible objects
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_bf.cpp | 11 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp index 55d9ecc68d7..d883b5609bd 100644 --- a/src/server/scripts/Commands/cs_bf.cpp +++ b/src/server/scripts/Commands/cs_bf.cpp @@ -26,6 +26,7 @@ EndScriptData */ #include "BattlefieldMgr.h" #include "Chat.h" #include "ChatCommand.h" +#include "Player.h" #include "RBAC.h" using namespace Trinity::ChatCommands; @@ -54,7 +55,7 @@ public: static bool HandleBattlefieldStart(ChatHandler* handler, uint32 battleId) { - Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleId); + Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(handler->GetPlayer()->GetMap(), battleId); if (!bf) return false; @@ -69,7 +70,7 @@ public: static bool HandleBattlefieldEnd(ChatHandler* handler, uint32 battleId) { - Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleId); + Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(handler->GetPlayer()->GetMap(), battleId); if (!bf) return false; @@ -84,7 +85,7 @@ public: static bool HandleBattlefieldEnable(ChatHandler* handler, uint32 battleId) { - Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleId); + Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(handler->GetPlayer()->GetMap(), battleId); if (!bf) return false; @@ -107,7 +108,7 @@ public: static bool HandleBattlefieldSwitch(ChatHandler* handler, uint32 battleId) { - Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleId); + Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(handler->GetPlayer()->GetMap(), battleId); if (!bf) return false; @@ -121,7 +122,7 @@ public: static bool HandleBattlefieldTimer(ChatHandler* handler, uint32 battleId, uint32 time) { - Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleId); + Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(handler->GetPlayer()->GetMap(), battleId); if (!bf) return false; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 97b772f18c9..b3879bafd56 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1408,7 +1408,7 @@ public: nearestLoc = bg->GetClosestGraveyard(player); else { - if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId())) + if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetMap(), player->GetZoneId())) nearestLoc = bf->GetClosestGraveyard(player); else nearestLoc = sObjectMgr->GetClosestGraveyard(*player, player->GetTeam(), player); |
