mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
SCI32: Fix restoring games from Torin's game restore dialog
The list in kListEachElementDo may be invalidated after a selector invocation
This commit is contained in:
@@ -576,6 +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)
|
||||
return s->r_acc;
|
||||
}
|
||||
|
||||
curNode = s->_segMan->lookupNode(list->nextNodes[list->numRecursions]);
|
||||
|
||||
Reference in New Issue
Block a user