aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorJeremy <Golrag@users.noreply.github.com>2025-10-02 21:38:53 +0200
committerGitHub <noreply@github.com>2025-10-02 21:38:53 +0200
commit16edee0b0ea805f5d8f0abf5eedb2c66a6edb23f (patch)
tree166dd4b12428238eb32261c3d0c03b844c01e2a6 /src/server/scripts/Commands
parent3fb6401b043788d1182c93b48d00d365ba05ab4c (diff)
Scripts/Commands: Improve .debug arena (#31292)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 68020eb435d..3785f81f70a 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -39,6 +39,7 @@ EndScriptData */
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "Language.h"
+#include "LFG.h"
#include "Log.h"
#include "M2Stores.h"
#include "MapManager.h"
@@ -856,9 +857,20 @@ public:
return true;
}
- static bool HandleDebugArenaCommand(ChatHandler* /*handler*/)
+ static bool HandleDebugArenaCommand(ChatHandler* handler, uint32 battlemasterListId)
{
- sBattlegroundMgr->ToggleArenaTesting();
+ bool successful = sBattlegroundMgr->ToggleArenaTesting(battlemasterListId);
+ if (!successful)
+ {
+ handler->PSendSysMessage("BattlemasterListId %u does not exist or is not an arena.", battlemasterListId);
+ handler->SetSentErrorMessage(true);
+ return true;
+ }
+
+ if (!battlemasterListId || !handler || !handler->GetSession())
+ return true;
+
+ BattlegroundMgr::QueuePlayerForArena(handler->GetSession()->GetPlayer(), 0, lfg::PLAYER_ROLE_DAMAGE);
return true;
}