diff options
Diffstat (limited to 'engines/adl')
-rw-r--r-- | engines/adl/adl.cpp | 6 | ||||
-rw-r--r-- | engines/adl/adl.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index 62f07ad639..ad409b74ee 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -58,6 +58,7 @@ AdlEngine::AdlEngine(OSystem *syst, const AdlGameDescription *gd) : _graphics(nullptr), _isRestarting(false), _isRestoring(false), + _isQuitting(false), _skipOneCommand(false), _gameDescription(gd), _saveVerb(0), @@ -553,7 +554,7 @@ Common::Error AdlEngine::run() { _display->setMode(DISPLAY_MODE_MIXED); - while (1) { + while (!_isQuitting) { uint verb = 0, noun = 0; _isRestarting = false; @@ -1101,7 +1102,8 @@ int AdlEngine::o1_quit(ScriptEnv &e) { OP_DEBUG_0("\tQUIT_GAME()"); printMessage(_messageIds.thanksForPlaying); - quitGame(); + // We use _isRestarting to abort the current game loop iteration + _isQuitting = _isRestarting = true; return -1; } diff --git a/engines/adl/adl.h b/engines/adl/adl.h index 971336ef50..fc696f074f 100644 --- a/engines/adl/adl.h +++ b/engines/adl/adl.h @@ -359,7 +359,7 @@ protected: // Game state State _state; - bool _isRestarting, _isRestoring; + bool _isRestarting, _isRestoring, _isQuitting; bool _skipOneCommand; private: |