aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorArnaud Boutonné2010-10-10 13:06:48 +0000
committerArnaud Boutonné2010-10-10 13:06:48 +0000
commit440bcaa06034244dc00715bb20afc0b3205aedbc (patch)
tree41afde8fbef6b649f832514ad90d82e4335315ca /engines
parente5d17fedf79770c8ab6cb866fa4d2ee050576b8f (diff)
downloadscummvm-rg350-440bcaa06034244dc00715bb20afc0b3205aedbc.tar.gz
scummvm-rg350-440bcaa06034244dc00715bb20afc0b3205aedbc.tar.bz2
scummvm-rg350-440bcaa06034244dc00715bb20afc0b3205aedbc.zip
HUGO: Fix 'Exit' command behavior in the DOS versions
svn-id: r53116
Diffstat (limited to 'engines')
-rw-r--r--engines/hugo/engine.cpp1
-rw-r--r--engines/hugo/game.h1
-rw-r--r--engines/hugo/hugo.cpp7
-rw-r--r--engines/hugo/parser.cpp3
4 files changed, 7 insertions, 5 deletions
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