diff options
author | Filippos Karapetis | 2009-02-12 15:13:52 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-02-12 15:13:52 +0000 |
commit | 0015657caad6d4824a3b146fb34c4255aeeff72b (patch) | |
tree | d5d1b0da7d3799f43a67464c2d6c4c258b90b1cb /engines/agi/cycle.cpp | |
parent | 521cc089110501c456844a4bc5963bd6d8e4df5c (diff) | |
download | scummvm-rg350-0015657caad6d4824a3b146fb34c4255aeeff72b.tar.gz scummvm-rg350-0015657caad6d4824a3b146fb34c4255aeeff72b.tar.bz2 scummvm-rg350-0015657caad6d4824a3b146fb34c4255aeeff72b.zip |
Fix for bug #2541237 - "AGI: Restart quits ScummVM"
svn-id: r36279
Diffstat (limited to 'engines/agi/cycle.cpp')
-rw-r--r-- | engines/agi/cycle.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index 49d7930972..cf987e66dc 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -115,7 +115,7 @@ void AgiEngine::interpretCycle() { oldSound = getflag(fSoundOn); _game.exitAllLogics = false; - while (runLogic(0) == 0 && !shouldQuit()) { + while (runLogic(0) == 0 && !(shouldQuit() || restartGame)) { _game.vars[vWordNotFound] = 0; _game.vars[vBorderTouchObj] = 0; _game.vars[vBorderCode] = 0; @@ -361,16 +361,11 @@ int AgiEngine::playGame() { _game.vars[vKey] = 0; } - // FIXME: This has been broken with the merge of the RTL GSoC project. shouldQuit() returns a boolean, and we're trying to - // check it against 0xff, which is never going to be true - //if (shouldQuit() == 0xff) - // ec = errRestartGame; - if (shouldPerformAutoSave(_lastSaveTime)) { saveGame(getSavegameFilename(0), "Autosave"); } - } while (shouldQuit() == 0); + } while (!(shouldQuit() || restartGame)); _sound->stopSound(); @@ -390,8 +385,11 @@ int AgiEngine::runGame() { if (agiInit() != errOK) break; - if (ec == errRestartGame) + + if (restartGame) { setflag(fRestartGame, true); + restartGame = false; + } // Set computer type (v20 i.e. vComputer) switch (getPlatform()) { @@ -444,7 +442,7 @@ int AgiEngine::runGame() { ec = playGame(); _game.state = STATE_LOADED; agiDeinit(); - } while (ec == errRestartGame); + } while (restartGame); delete _menu; _menu = NULL; |