Browse Source

♻️ Clean up debug options

pull/1258/head
Anders Jenbo 5 years ago
parent
commit
d9c1bc4579
  1. 6
      Source/debug.cpp
  2. 56
      Source/diablo.cpp
  3. 21
      Source/diablo.h

6
Source/debug.cpp

@ -129,6 +129,8 @@ void SetAllSpellsCheat()
SetSpellLevelCheat(SPL_BONESPIRIT, 1); SetSpellLevelCheat(SPL_BONESPIRIT, 1);
} }
int dbgplr;
void PrintDebugPlayer(BOOL bNextPlayer) void PrintDebugPlayer(BOOL bNextPlayer)
{ {
char dstr[128]; char dstr[128];
@ -153,6 +155,8 @@ void PrintDebugPlayer(BOOL bNextPlayer)
} }
} }
int dbgqst;
void PrintDebugQuest() void PrintDebugQuest()
{ {
char dstr[128]; char dstr[128];
@ -191,6 +195,8 @@ void PrintDebugMonster(int m)
NetSendCmdString(1 << myplr, dstr); NetSendCmdString(1 << myplr, dstr);
} }
int dbgmon;
void GetDebugMonster() void GetDebugMonster()
{ {
int mi1, mi2; int mi1, mi2;

56
Source/diablo.cpp

@ -52,23 +52,20 @@ Options sgOptions;
bool gbForceWindowed = false; bool gbForceWindowed = false;
bool gbShowIntro = true; bool gbShowIntro = true;
BOOL leveldebug; bool leveldebug = false;
#ifdef _DEBUG #ifdef _DEBUG
BOOL monstdebug; bool monstdebug = false;
_monster_id DebugMonsters[10]; _monster_id DebugMonsters[10];
int debugmonsttypes; int debugmonsttypes = 0;
BOOL visiondebug; bool visiondebug = false;
int questdebug = -1; int questdebug = -1;
int debug_mode_key_s; bool debug_mode_key_s = false;
int debug_mode_key_w; bool debug_mode_key_w = false;
int debug_mode_key_inverted_v; bool debug_mode_key_inverted_v = false;
int debug_mode_dollar_sign; bool debug_mode_dollar_sign = false;
int debug_mode_key_d; bool debug_mode_key_d = false;
int debug_mode_key_i; bool debug_mode_key_i = false;
int dbgplr; int arrowdebug = 0;
int dbgqst;
int dbgmon;
int arrowdebug;
#endif #endif
/** Specifies whether players are in non-PvP mode. */ /** Specifies whether players are in non-PvP mode. */
bool gbFriendlyMode = true; bool gbFriendlyMode = true;
@ -116,7 +113,6 @@ static void print_help_and_exit()
printInConsole(" %-20s %-30s\n", "-w", "Enable cheats"); printInConsole(" %-20s %-30s\n", "-w", "Enable cheats");
printInConsole(" %-20s %-30s\n", "-$", "Enable god mode"); printInConsole(" %-20s %-30s\n", "-$", "Enable god mode");
printInConsole(" %-20s %-30s\n", "-^", "Enable god mode and debug tools"); printInConsole(" %-20s %-30s\n", "-^", "Enable god mode and debug tools");
//printInConsole(" %-20s %-30s\n", "-b", "Enable item drop log");
printInConsole(" %-20s %-30s\n", "-v", "Highlight visibility"); printInConsole(" %-20s %-30s\n", "-v", "Highlight visibility");
printInConsole(" %-20s %-30s\n", "-i", "Ignore network timeout"); printInConsole(" %-20s %-30s\n", "-i", "Ignore network timeout");
//printInConsole(" %-20s %-30s\n", "-j <##>", "Init trigger at level"); //printInConsole(" %-20s %-30s\n", "-j <##>", "Init trigger at level");
@ -151,53 +147,49 @@ static void diablo_parse_flags(int argc, char **argv)
} else if (strcasecmp("-x", argv[i]) == 0) { } else if (strcasecmp("-x", argv[i]) == 0) {
gbForceWindowed = true; gbForceWindowed = true;
} else if (strcasecmp("--spawn", argv[i]) == 0) { } else if (strcasecmp("--spawn", argv[i]) == 0) {
forceSpawn = TRUE; forceSpawn = true;
} else if (strcasecmp("--diablo", argv[i]) == 0) { } else if (strcasecmp("--diablo", argv[i]) == 0) {
forceDiablo = TRUE; forceDiablo = true;
} else if (strcasecmp("--nestart", argv[i]) == 0) { } else if (strcasecmp("--nestart", argv[i]) == 0) {
gbNestArt = true; gbNestArt = true;
} else if (strcasecmp("--vanilla", argv[i]) == 0) { } else if (strcasecmp("--vanilla", argv[i]) == 0) {
gbVanilla = true; gbVanilla = true;
#ifdef _DEBUG #ifdef _DEBUG
} else if (strcasecmp("-^", argv[i]) == 0) { } else if (strcasecmp("-^", argv[i]) == 0) {
debug_mode_key_inverted_v = TRUE; debug_mode_key_inverted_v = true;
} else if (strcasecmp("-$", argv[i]) == 0) { } else if (strcasecmp("-$", argv[i]) == 0) {
debug_mode_dollar_sign = TRUE; debug_mode_dollar_sign = true;
/*
} else if (strcasecmp("-b", argv[i]) == 0) {
debug_mode_key_b = 1;
*/
} else if (strcasecmp("-d", argv[i]) == 0) { } else if (strcasecmp("-d", argv[i]) == 0) {
debug_mode_key_d = TRUE; debug_mode_key_d = true;
} else if (strcasecmp("-i", argv[i]) == 0) { } else if (strcasecmp("-i", argv[i]) == 0) {
debug_mode_key_i = TRUE; debug_mode_key_i = true;
/* /*
} else if (strcasecmp("-j", argv[i]) == 0) { } else if (strcasecmp("-j", argv[i]) == 0) {
debug_mode_key_J_trigger = argv[++i]; debug_mode_key_J_trigger = argv[++i];
*/ */
} else if (strcasecmp("-l", argv[i]) == 0) { } else if (strcasecmp("-l", argv[i]) == 0) {
setlevel = FALSE; setlevel = FALSE;
leveldebug = TRUE; leveldebug = true;
leveltype = SDL_atoi(argv[++i]); leveltype = SDL_atoi(argv[++i]);
currlevel = SDL_atoi(argv[++i]); currlevel = SDL_atoi(argv[++i]);
plr[0].plrlevel = currlevel; plr[0].plrlevel = currlevel;
} else if (strcasecmp("-m", argv[i]) == 0) { } else if (strcasecmp("-m", argv[i]) == 0) {
monstdebug = TRUE; monstdebug = true;
DebugMonsters[debugmonsttypes++] = (_monster_id)SDL_atoi(argv[++i]); DebugMonsters[debugmonsttypes++] = (_monster_id)SDL_atoi(argv[++i]);
} else if (strcasecmp("-q", argv[i]) == 0) { } else if (strcasecmp("-q", argv[i]) == 0) {
questdebug = SDL_atoi(argv[++i]); questdebug = SDL_atoi(argv[++i]);
} else if (strcasecmp("-r", argv[i]) == 0) { } else if (strcasecmp("-r", argv[i]) == 0) {
setseed = SDL_atoi(argv[++i]); setseed = SDL_atoi(argv[++i]);
} else if (strcasecmp("-s", argv[i]) == 0) { } else if (strcasecmp("-s", argv[i]) == 0) {
debug_mode_key_s = TRUE; debug_mode_key_s = true;
} else if (strcasecmp("-t", argv[i]) == 0) { } else if (strcasecmp("-t", argv[i]) == 0) {
leveldebug = TRUE; leveldebug = true;
setlevel = TRUE; setlevel = true;
setlvlnum = SDL_atoi(argv[++i]); setlvlnum = SDL_atoi(argv[++i]);
} else if (strcasecmp("-v", argv[i]) == 0) { } else if (strcasecmp("-v", argv[i]) == 0) {
visiondebug = TRUE; visiondebug = true;
} else if (strcasecmp("-w", argv[i]) == 0) { } else if (strcasecmp("-w", argv[i]) == 0) {
debug_mode_key_w = TRUE; debug_mode_key_w = true;
#endif #endif
} else { } else {
printInConsole("unrecognized option '%s'\n", argv[i]); printInConsole("unrecognized option '%s'\n", argv[i]);

21
Source/diablo.h

@ -159,21 +159,18 @@ void diablo_color_cyc_logic();
/* rdata */ /* rdata */
extern bool gbForceWindowed; extern bool gbForceWindowed;
extern BOOL leveldebug; extern bool leveldebug;
#ifdef _DEBUG #ifdef _DEBUG
extern BOOL monstdebug; extern bool monstdebug;
extern int debugmonsttypes;
extern _monster_id DebugMonsters[10]; extern _monster_id DebugMonsters[10];
extern BOOL visiondebug; extern int debugmonsttypes;
extern bool visiondebug;
extern int questdebug; extern int questdebug;
extern int debug_mode_key_w; extern bool debug_mode_key_w;
extern int debug_mode_key_inverted_v; extern bool debug_mode_key_inverted_v;
extern int debug_mode_dollar_sign; extern bool debug_mode_dollar_sign;
extern int debug_mode_key_d; extern bool debug_mode_key_d;
extern int debug_mode_key_i; extern bool debug_mode_key_i;
extern int dbgplr;
extern int dbgqst;
extern int dbgmon;
#endif #endif
extern bool gbFriendlyMode; extern bool gbFriendlyMode;
extern bool gbFriendlyFire; extern bool gbFriendlyFire;

Loading…
Cancel
Save