aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/console.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-06-03 01:14:16 -0400
committerMatthew Hoops2011-06-03 01:14:16 -0400
commit224c71e483e09931ba386555ff3b436b9defe63d (patch)
tree8e6178331a7bbd3ee1be318d3fc7a7c7f478468f /engines/sci/console.cpp
parentd4c92983920cfe3b25a22d91e12c750e591b917e (diff)
parent547fd1bdcabcba0e741eb31100ba99ff73399d24 (diff)
downloadscummvm-rg350-224c71e483e09931ba386555ff3b436b9defe63d.tar.gz
scummvm-rg350-224c71e483e09931ba386555ff3b436b9defe63d.tar.bz2
scummvm-rg350-224c71e483e09931ba386555ff3b436b9defe63d.zip
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/sci/console.cpp')
-rw-r--r--engines/sci/console.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 5f5af195b5..af945247ba 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -74,6 +74,9 @@ static int parse_reg_t(EngineState *s, const char *str, reg_t *dest, bool mayBeV
Console::Console(SciEngine *engine) : GUI::Debugger(),
_engine(engine), _debugState(engine->_debugState) {
+ assert(_engine);
+ assert(_engine->_gamestate);
+
// Variables
DVar_Register("sleeptime_factor", &g_debug_sleeptime_factor, DVAR_INT, 0);
DVar_Register("gc_interval", &engine->_gamestate->scriptGCInterval, DVAR_INT, 0);
@@ -3359,20 +3362,22 @@ bool Console::cmdSfx01Track(int argc, const char **argv) {
bool Console::cmdQuit(int argc, const char **argv) {
if (argc != 2) {
- DebugPrintf("%s game - exit gracefully\n", argv[0]);
- DebugPrintf("%s now - exit ungracefully\n", argv[0]);
- return true;
}
- if (!scumm_stricmp(argv[1], "game")) {
+ if (argc == 2 && !scumm_stricmp(argv[1], "now")) {
+ // Quit ungracefully
+ g_system->quit();
+ } else if (argc == 1 || (argc == 2 && !scumm_stricmp(argv[1], "game"))) {
+
// Quit gracefully
_engine->_gamestate->abortScriptProcessing = kAbortQuitGame; // Terminate VM
_debugState.seeking = kDebugSeekNothing;
_debugState.runningStep = 0;
- } else if (!scumm_stricmp(argv[1], "now")) {
- // Quit ungracefully
- exit(0);
+ } else {
+ DebugPrintf("%s [game] - exit gracefully\n", argv[0]);
+ DebugPrintf("%s now - exit ungracefully\n", argv[0]);
+ return true;
}
return Cmd_Exit(0, 0);