From 440bcaa06034244dc00715bb20afc0b3205aedbc Mon Sep 17 00:00:00 2001 From: Arnaud Boutonné Date: Sun, 10 Oct 2010 13:06:48 +0000 Subject: HUGO: Fix 'Exit' command behavior in the DOS versions svn-id: r53116 --- engines/hugo/engine.cpp | 1 + engines/hugo/game.h | 1 + engines/hugo/hugo.cpp | 7 ++++--- engines/hugo/parser.cpp | 3 +-- 4 files changed, 7 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/hugo/engine.cpp b/engines/hugo/engine.cpp index ddc8d408fb..d1d3e92cb2 100644 --- a/engines/hugo/engine.cpp +++ b/engines/hugo/engine.cpp @@ -91,6 +91,7 @@ void HugoEngine::initStatus() { _status.jumpExitFl = false; // Can't jump to a screen exit _status.godModeFl = false; // No special cheats allowed _status.helpFl = false; // Not calling WinHelp() + _status.doQuitFl = false; _status.path[0] = 0; // Path to write files _status.saveSlot = 0; // Slot to save/restore game _status.screenWidth = 0; // Desktop screen width diff --git a/engines/hugo/game.h b/engines/hugo/game.h index 09bdce711d..869aa1baa4 100644 --- a/engines/hugo/game.h +++ b/engines/hugo/game.h @@ -796,6 +796,7 @@ struct status_t { // Game status (not saved) bool jumpExitFl; // Allowed to jump to a screen exit bool godModeFl; // Allow DEBUG features in live version bool helpFl; // Calling WinHelp (don't disable music) + bool doQuitFl; uint32 tick; // Current time in ticks uint32 saveTick; // Time of last save in ticks vstate_t viewState; // View state machine diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index acc047b68d..100f3b85f2 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -223,9 +223,9 @@ Common::Error HugoEngine::run() { // Start the state machine _status.viewState = V_INTROINIT; - bool doQuitFl = false; + _status.doQuitFl = false; - while (!doQuitFl) { + while (!_status.doQuitFl) { g_system->updateScreen(); runMachine(); @@ -253,7 +253,7 @@ Common::Error HugoEngine::run() { _status.rightButtonFl = false; break; case Common::EVENT_QUIT: - doQuitFl = true; + _status.doQuitFl = true; break; default: break; @@ -322,6 +322,7 @@ void HugoEngine::runMachine() { break; case V_EXIT: // Game over or user exited gameStatus.viewState = V_IDLE; + _status.doQuitFl = true; break; } } diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index 9468ffbe54..a680baf49c 100644 --- a/engines/hugo/parser.cpp +++ b/engines/hugo/parser.cpp @@ -910,8 +910,7 @@ void Parser_v1d::lineHandler() { if (!strcmp("exit", _line) || strstr(_line, "quit")) { if (Utils::Box(BOX_YESNO, "%s", _vm._textParser[kTBExit_1d]) != 0) _vm.endGame(); - else - return; + return; } // SAVE/RESTORE -- cgit v1.2.3