From 91e909a25cf056dba37eb6a68bd9ba957cd18175 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 22 Jul 2010 17:53:32 +0000 Subject: [PATCH] SCI: Added a sanity check for rev 51152. If a node has been deleted, it shouldn't have a successor node svn-id: r51154 --- engines/sci/graphics/animate.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index d95125e0a85..229d38c7773 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -91,6 +91,8 @@ bool GfxAnimate::invoke(List *list, int argc, reg_t *argv) { signal = readSelectorValue(_s->_segMan, curObject, SELECTOR(signal)); if (!(signal & kSignalFrozen)) { + reg_t nextNode = curNode->succ; + // Call .doit method of that object invokeSelector(_s, curObject, SELECTOR(doit), argc, argv, 0); @@ -102,6 +104,10 @@ bool GfxAnimate::invoke(List *list, int argc, reg_t *argv) { // The node might have been deallocated at this point (e.g. LSL2, room 42), // in which case the node reference will be null and the loop will stop below. curNode = _s->_segMan->lookupNode(curAddress, false); + + // Sanity check: If the node has been deleted, it shouldn't have a successor node + if (!curNode && !nextNode.isNull()) + error("kAnimate: list node has been deleted, but it has a successor node"); } if (curNode) {