Browse Source

Remove -m debug command line

pull/2891/head
obligaron 5 years ago committed by Anders Jenbo
parent
commit
0acaec710c
  1. 7
      Source/diablo.cpp
  2. 3
      Source/diablo.h
  3. 33
      Source/monster.cpp

7
Source/diablo.cpp

@ -101,9 +101,6 @@ std::array<Keymapper::ActionIndex, 4> quickSpellActionIndexes;
bool gbForceWindowed = false;
#ifdef _DEBUG
bool monstdebug = false;
_monster_id DebugMonsters[10];
int debugmonsttypes = 0;
bool debug_mode_key_inverted_v = false;
bool debug_mode_key_i = false;
std::vector<std::string> DebugCmdsFromCommandLine;
@ -817,7 +814,6 @@ void RunGameLoop(interface_mode uMsg)
printInConsole("\nDebug options:\n");
printInConsole(" %-20s %-30s\n", "-^", "Enable debug tools");
printInConsole(" %-20s %-30s\n", "-i", "Ignore network timeout");
printInConsole(" %-20s %-30s\n", "-m <##>", "Add debug monster, up to 10 allowed");
printInConsole(" %-20s %-30s\n", "+<internal command>", "Pass commands to the engine");
#endif
printInConsole("%s", _("\nReport bugs at https://github.com/diasurgical/devilutionX/\n"));
@ -879,9 +875,6 @@ void DiabloParseFlags(int argc, char **argv)
debug_mode_key_inverted_v = true;
} else if (strcasecmp("-i", argv[i]) == 0) {
debug_mode_key_i = true;
} else if (strcasecmp("-m", argv[i]) == 0) {
monstdebug = true;
DebugMonsters[debugmonsttypes++] = (_monster_id)SDL_atoi(argv[++i]);
} else if (argv[i][0] == '+') {
if (!currentCommand.empty())
DebugCmdsFromCommandLine.push_back(currentCommand);

3
Source/diablo.h

@ -106,9 +106,6 @@ void diablo_color_cyc_logic();
extern Keymapper keymapper;
extern bool gbForceWindowed;
#ifdef _DEBUG
extern bool monstdebug;
extern _monster_id DebugMonsters[10];
extern int debugmonsttypes;
extern bool debug_mode_key_inverted_v;
extern bool debug_mode_key_i;
#endif

33
Source/monster.cpp

@ -3642,29 +3642,20 @@ void GetLevelMTypes()
}
}
#ifdef _DEBUG
if (monstdebug) {
for (int i = 0; i < debugmonsttypes; i++)
AddMonsterType(DebugMonsters[i], PLACE_SCATTER);
} else
#endif
{
while (nt > 0 && LevelMonsterTypeCount < MAX_LVLMTYPES && monstimgtot < 4000) {
for (int i = 0; i < nt;) {
if (MonstersData[typelist[i]].mImage > 4000 - monstimgtot) {
typelist[i] = typelist[--nt];
continue;
}
i++;
}
if (nt != 0) {
int i = GenerateRnd(nt);
AddMonsterType(typelist[i], PLACE_SCATTER);
while (nt > 0 && LevelMonsterTypeCount < MAX_LVLMTYPES && monstimgtot < 4000) {
for (int i = 0; i < nt;) {
if (MonstersData[typelist[i]].mImage > 4000 - monstimgtot) {
typelist[i] = typelist[--nt];
continue;
}
i++;
}
if (nt != 0) {
int i = GenerateRnd(nt);
AddMonsterType(typelist[i], PLACE_SCATTER);
typelist[i] = typelist[--nt];
}
}

Loading…
Cancel
Save