aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2016-08-23 13:08:37 +0300
committerFilippos Karapetis2016-08-23 13:08:37 +0300
commit6929cc65f8e9e46ce5a04f75bcf48d0d1ada2b38 (patch)
treec8e09cb4c44321a9bb40aaa9f3fa9daeb485caed
parent6ce472a12a37f54ca00e6d4262eac42e75f9863a (diff)
downloadscummvm-rg350-6929cc65f8e9e46ce5a04f75bcf48d0d1ada2b38.tar.gz
scummvm-rg350-6929cc65f8e9e46ce5a04f75bcf48d0d1ada2b38.tar.bz2
scummvm-rg350-6929cc65f8e9e46ce5a04f75bcf48d0d1ada2b38.zip
SCI32: Explicitly abord kEachElementDo when a game is being loaded
This is a better check than the one in commit 3d1f1a3a21
-rw-r--r--engines/sci/engine/klists.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index bc559148ac..91a0484703 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -576,9 +576,10 @@ reg_t kListEachElementDo(EngineState *s, int argc, reg_t *argv) {
}
} else {
invokeSelector(s, curObject, slc, argc, argv, argc - 2, argv + 2);
- // Check if the list has been invalidated after the call above
- // (e.g. when restoring in Torin)
- if (s->_segMan->getSegmentType(argv[0].getSegment()) != SEG_TYPE_LISTS)
+ // Check if the call above leads to a game restore, in which case
+ // the segment manager will be reset, and the original list will
+ // be invalidated
+ if (s->abortScriptProcessing == kAbortLoadGame)
return s->r_acc;
}