diff options
Diffstat (limited to 'engines/mohawk/console.cpp')
-rw-r--r-- | engines/mohawk/console.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp index 2e83eb3328..d95c91e3be 100644 --- a/engines/mohawk/console.cpp +++ b/engines/mohawk/console.cpp @@ -426,13 +426,11 @@ bool RivenConsole::Cmd_CurStack(int argc, const char **argv) { } bool RivenConsole::Cmd_ChangeStack(int argc, const char **argv) { - byte i; - if (argc < 3) { DebugPrintf("Usage: changeStack <stack> <card>\n\n"); DebugPrintf("Stacks:\n=======\n"); - for (i = 0; i <= tspit; i++) + for (uint i = kStackFirst; i <= kStackLast; i++) DebugPrintf(" %s\n", _vm->getStackName(i).c_str()); DebugPrintf("\n"); @@ -440,20 +438,21 @@ bool RivenConsole::Cmd_ChangeStack(int argc, const char **argv) { return true; } - byte stackNum = 0; + uint stack = kStackUnknown; - for (i = 1; i <= tspit + 1; i++) - if (!scumm_stricmp(argv[1], _vm->getStackName(i - 1).c_str())) { - stackNum = i; + for (uint i = kStackFirst; i <= kStackLast; i++) { + if (!scumm_stricmp(argv[1], _vm->getStackName(i).c_str())) { + stack = i; break; } + } - if (!stackNum) { + if (stack == kStackUnknown) { DebugPrintf("\'%s\' is not a stack name!\n", argv[1]); return true; } - _vm->changeToStack(stackNum - 1); + _vm->changeToStack(stack); _vm->changeToCard((uint16)atoi(argv[2])); return false; @@ -494,21 +493,20 @@ bool RivenConsole::Cmd_DumpScript(int argc, const char **argv) { } uint16 oldStack = _vm->getCurStack(); + uint newStack = kStackUnknown; - byte newStack = 0; - - for (byte i = 1; i <= tspit + 1; i++) - if (!scumm_stricmp(argv[1], _vm->getStackName(i - 1).c_str())) { + for (uint i = kStackFirst; i <= kStackLast; i++) { + if (!scumm_stricmp(argv[1], _vm->getStackName(i).c_str())) { newStack = i; break; } + } - if (!newStack) { + if (newStack == kStackUnknown) { DebugPrintf("\'%s\' is not a stack name!\n", argv[1]); return true; } - newStack--; _vm->changeToStack(newStack); // Load in Variable Names |