aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-11-15 20:59:03 +0100
committerWillem Jan Palenstijn2011-11-15 20:59:03 +0100
commit05c748efa3d42ffb3bfe64770837efd24a9fa29c (patch)
tree0adb90a3d1db6af3c7a48098bf9cf2166478fce4 /engines
parent0888e636d7265e2feacc8db972d73f919f7279a6 (diff)
downloadscummvm-rg350-05c748efa3d42ffb3bfe64770837efd24a9fa29c.tar.gz
scummvm-rg350-05c748efa3d42ffb3bfe64770837efd24a9fa29c.tar.bz2
scummvm-rg350-05c748efa3d42ffb3bfe64770837efd24a9fa29c.zip
DREAMWEB: Fix crash on quit
The functions 'mainscreen' and 'screenupdate' can set kQuitrequested, so we have to check that from their callers.
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp3
-rw-r--r--engines/dreamweb/stubs.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 6643ab0204..ba315f2051 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -13491,6 +13491,9 @@ void DreamGenContext::screenupdate() {
STACK_CHECK;
newplace();
mainscreen();
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ return /* (finishearly) */;
animpointer();
showpointer();
_cmp(data.word(kWatchingtime), 0);
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 97d0f08555..798772168c 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -140,6 +140,9 @@ void DreamGenContext::dreamweb() {
screenupdate();
+ if (data.byte(kQuitrequested))
+ return; // exit game
+
if (data.byte(kWongame) != 0) {
// "endofgame"
clearbeforeload();