aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-06-18 15:40:18 +0000
committerFilippos Karapetis2010-06-18 15:40:18 +0000
commit680f7c897af5dac091e1abc47f0500cccbd07a51 (patch)
tree62e8056d2af6c50aa7812d88f8e42776265a8aaa
parent5d378574a438f7b7f60fd01b88dd58e05c0bcd9b (diff)
downloadscummvm-rg350-680f7c897af5dac091e1abc47f0500cccbd07a51.tar.gz
scummvm-rg350-680f7c897af5dac091e1abc47f0500cccbd07a51.tar.bz2
scummvm-rg350-680f7c897af5dac091e1abc47f0500cccbd07a51.zip
Fixed a problem in kAnimate which occurred when a list was modified by a call (e.g. in KQ1 demo, PQ2)
svn-id: r50022
-rw-r--r--engines/sci/engine/seg_manager.cpp8
-rw-r--r--engines/sci/graphics/animate.cpp3
2 files changed, 4 insertions, 7 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index f19c03d5a8..5371238304 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -531,12 +531,6 @@ Node *SegManager::lookupNode(reg_t addr) {
SegmentType type = getSegmentType(addr.segment);
if (type != SEG_TYPE_NODES) {
- if (g_sci->getGameId() == "kq1sci") {
- // WORKAROUND: The demo of KQ1 is trying to use an invalid memory reference as a list node
- warning("Attempt to use non-node %04x:%04x (type %d) as list node", PRINT_REG(addr), type);
- return NULL;
- }
-
error("Attempt to use non-node %04x:%04x (type %d) as list node", PRINT_REG(addr), type);
return NULL;
}
@@ -544,7 +538,7 @@ Node *SegManager::lookupNode(reg_t addr) {
NodeTable *nt = (NodeTable *)_heap[addr.segment];
if (!nt->isValidEntry(addr.offset)) {
- error("Attempt to use invalid reference %04x:%04x as list node", PRINT_REG(addr));
+ error("Attempt to use invalid or discarded reference %04x:%04x as list node", PRINT_REG(addr));
return NULL;
}
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp
index 598724f2be..06054f3a19 100644
--- a/engines/sci/graphics/animate.cpp
+++ b/engines/sci/graphics/animate.cpp
@@ -606,6 +606,9 @@ void GfxAnimate::kernelAnimate(reg_t listReference, bool cycle, int argc, reg_t
if (cycle) {
if (!invoke(list, argc, argv))
return;
+
+ // Look up the list again, as it may have been modified
+ list = _s->_segMan->lookupList(listReference);
}
Port *oldPort = _ports->setPort((Port *)_ports->_picWind);