HUGO: Fix 'Exit' command behavior in the DOS versions

svn-id: r53116
This commit is contained in:
Arnaud Boutonné 2010-10-10 13:06:48 +00:00
parent e5d17fedf7
commit 440bcaa060
4 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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;
}
}

View File

@ -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