aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kevent.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2015-04-26 00:43:53 +0200
committerWillem Jan Palenstijn2015-04-26 00:48:07 +0200
commit4c03e4b699916a9b9fe71afffaf41c283045216e (patch)
tree513fe1aa95028905d468efed4dd585ddd9af9c19 /engines/sci/engine/kevent.cpp
parent53f9dac75ef0c0c22c513068eaccf8c96457a438 (diff)
downloadscummvm-rg350-4c03e4b699916a9b9fe71afffaf41c283045216e.tar.gz
scummvm-rg350-4c03e4b699916a9b9fe71afffaf41c283045216e.tar.bz2
scummvm-rg350-4c03e4b699916a9b9fe71afffaf41c283045216e.zip
SCI: Stop processing in kGetEvent after loading
getSciEvent can trigger the main ScummVM menu, which can trigger loading a game, which will invalidate the game state that kGetEvent is operating on. Other kernel functions may still have the same problem, and a better solution may be necessary.
Diffstat (limited to 'engines/sci/engine/kevent.cpp')
-rw-r--r--engines/sci/engine/kevent.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index cb81da2279..dfa29bd047 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -74,6 +74,11 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
curEvent = g_sci->getEventManager()->getSciEvent(mask);
+ // Aborted during getSciEvent (e.g., due to loading a game from the
+ // ScummVM menu), so return immediately
+ if (s->abortScriptProcessing)
+ return NULL_REG;
+
// For a real event we use its associated mouse position
mousePos = curEvent.mousePos;
#ifdef ENABLE_SCI32