diff options
author | Jordi Vilalta Prat | 2009-01-07 23:05:28 +0000 |
---|---|---|
committer | Jordi Vilalta Prat | 2009-01-07 23:05:28 +0000 |
commit | 1f63a1dfcd69af0db9ba039b9c316541180a7795 (patch) | |
tree | f650c8f2c97095c30913afb2d0de9abbe2eddabf /engines/groovie/groovie.cpp | |
parent | f07d962734e294a9536917710211fde04cff688c (diff) | |
download | scummvm-rg350-1f63a1dfcd69af0db9ba039b9c316541180a7795.tar.gz scummvm-rg350-1f63a1dfcd69af0db9ba039b9c316541180a7795.tar.bz2 scummvm-rg350-1f63a1dfcd69af0db9ba039b9c316541180a7795.zip |
Fix an invalid access when the quit opcode occupies the last byte of the script, due to the quit status being updated by the event loop
svn-id: r35779
Diffstat (limited to 'engines/groovie/groovie.cpp')
-rw-r--r-- | engines/groovie/groovie.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index c30154ba01..c0e4428a88 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -123,7 +123,7 @@ Common::Error GroovieEngine::init() { // A new entry index++; } else if (line.hasPrefix("boot: ") && index == _gameDescription->indexEntry) { - // It's the boot of the entry were looking for, + // It's the boot of the entry we're looking for, // get the script filename filename = line.c_str() + 6; found = true; @@ -219,6 +219,12 @@ Common::Error GroovieEngine::go() { } } + // The event loop may have triggered the quit status. In this case, + // stop the execution. + if (shouldQuit()) { + continue; + } + if (_waitingForInput) { // Still waiting for input, just update the mouse, game timer and then wait a bit more _cursorMan->animate(); |