diff options
author | Filippos Karapetis | 2010-06-18 01:27:25 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-18 01:27:25 +0000 |
commit | 30ea5f3ad2c45702f15e0941829fe002a4d22711 (patch) | |
tree | ed8ff918ed4b98f9a6aa0adc18c8598bf901bf34 /engines/sci/engine/seg_manager.cpp | |
parent | ac4659b92acd42690dae6b09a1a72bb0d30c1764 (diff) | |
download | scummvm-rg350-30ea5f3ad2c45702f15e0941829fe002a4d22711.tar.gz scummvm-rg350-30ea5f3ad2c45702f15e0941829fe002a4d22711.tar.bz2 scummvm-rg350-30ea5f3ad2c45702f15e0941829fe002a4d22711.zip |
Added a workaround for the KQ1 demo (looks like a script bug)
svn-id: r49984
Diffstat (limited to 'engines/sci/engine/seg_manager.cpp')
-rw-r--r-- | engines/sci/engine/seg_manager.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 58b496ccfc..5c49855367 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -528,15 +528,23 @@ Node *SegManager::lookupNode(reg_t addr) { if (addr.isNull()) return NULL; // Non-error null - if (getSegmentType(addr.segment) != SEG_TYPE_NODES) { - error("Attempt to use non-node %04x:%04x as list node", PRINT_REG(addr)); + SegmentType type = getSegmentType(addr.segment); + + if (type != SEG_TYPE_NODES) { + if (g_sci->getGameId() == "kq1sci") { + // 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; } NodeTable *nt = (NodeTable *)_heap[addr.segment]; if (!nt->isValidEntry(addr.offset)) { - error("Attempt to use non-node %04x:%04x as list node", PRINT_REG(addr)); + error("Attempt to use invalid reference %04x:%04x as list node", PRINT_REG(addr)); return NULL; } |