From 72ebba05917e73f53b1c725f087e3ded2f17c1a3 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 23 Mar 2021 20:30:50 +0100 Subject: [PATCH] :triangular_flag_on_post: Implement -j debug command --- Source/diablo.cpp | 7 +++---- Source/diablo.h | 1 + Source/trigs.cpp | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 98c16ec4e..1633a6155 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -65,6 +65,7 @@ bool debug_mode_key_inverted_v = false; bool debug_mode_dollar_sign = false; bool debug_mode_key_d = false; bool debug_mode_key_i = false; +int debug_mode_key_j = 0; int arrowdebug = 0; #endif /** Specifies whether players are in non-PvP mode. */ @@ -115,7 +116,7 @@ static void print_help_and_exit() printInConsole(" %-20s %-30s\n", "-^", "Enable god mode and debug tools"); printInConsole(" %-20s %-30s\n", "-v", "Highlight visibility"); printInConsole(" %-20s %-30s\n", "-i", "Ignore network timeout"); - //printInConsole(" %-20s %-30s\n", "-j <##>", "Init trigger at level"); + printInConsole(" %-20s %-30s\n", "-j <##>", "Mausoleum warps to given level"); printInConsole(" %-20s %-30s\n", "-l <##> <##>", "Start in level as type"); printInConsole(" %-20s %-30s\n", "-m <##>", "Add debug monster, up to 10 allowed"); printInConsole(" %-20s %-30s\n", "-q <#>", "Force a certain quest"); @@ -163,10 +164,8 @@ static void diablo_parse_flags(int argc, char **argv) debug_mode_key_d = true; } else if (strcasecmp("-i", argv[i]) == 0) { debug_mode_key_i = true; - /* } else if (strcasecmp("-j", argv[i]) == 0) { - debug_mode_key_J_trigger = argv[++i]; - */ + debug_mode_key_j = SDL_atoi(argv[++i]); } else if (strcasecmp("-l", argv[i]) == 0) { setlevel = FALSE; leveldebug = true; diff --git a/Source/diablo.h b/Source/diablo.h index bca209f78..fcc4e45ae 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -171,6 +171,7 @@ extern bool debug_mode_key_inverted_v; extern bool debug_mode_dollar_sign; extern bool debug_mode_key_d; extern bool debug_mode_key_i; +extern int debug_mode_key_j; #endif extern bool gbFriendlyMode; extern bool gbFriendlyFire; diff --git a/Source/trigs.cpp b/Source/trigs.cpp index 27a3a7dda..423425dcf 100644 --- a/Source/trigs.cpp +++ b/Source/trigs.cpp @@ -77,6 +77,8 @@ void InitTownTriggers() trigs[numtrigs]._ty = 21; trigs[numtrigs]._tmsg = WM_DIABTOWNWARP; trigs[numtrigs]._tlvl = 5; + if (debug_mode_key_j) + trigs[numtrigs]._tlvl = debug_mode_key_j; numtrigs++; } if (gbIsMultiplayer || plr[myplr].pTownWarps & 2 || (gbIsHellfire && plr[myplr]._pLevel >= 15)) {