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:
parent
cd00132d23
commit
3d1f1a3a21
1 changed files with 4 additions and 0 deletions
|
@ -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]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue