aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-06-13 21:43:13 +0000
committerFilippos Karapetis2010-06-13 21:43:13 +0000
commita4ac9347d4bbac0ee8bef8786c9e23831ad60636 (patch)
tree439c3df4ce38820af60d01840fe15e69cb917d0a /engines
parent4c6d276ce914cafc170732fb7203145c8a763b37 (diff)
downloadscummvm-rg350-a4ac9347d4bbac0ee8bef8786c9e23831ad60636.tar.gz
scummvm-rg350-a4ac9347d4bbac0ee8bef8786c9e23831ad60636.tar.bz2
scummvm-rg350-a4ac9347d4bbac0ee8bef8786c9e23831ad60636.zip
Fixed regression from commit #49251, and added an explanation. Calls to kNewNode with 1 parameter are handled properly again. Fixes the demo of Phantasmagoria 1. Thanks to lskovlun and waltervn for spotting this
svn-id: r49638
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/klists.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 18d6638e92..050c8e515f 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -157,7 +157,9 @@ reg_t kDisposeList(EngineState *s, int argc, reg_t *argv) {
reg_t kNewNode(EngineState *s, int argc, reg_t *argv) {
reg_t nodeValue = argv[0];
- reg_t nodeKey = (argc == 2) ? argv[1] : NULL_REG;
+ // Some SCI32 games call this with 1 parameter (e.g. the demo of Phantasmagoria).
+ // Set the key to be the same as the value in this case
+ reg_t nodeKey = (argc == 2) ? argv[1] : argv[0];
s->r_acc = s->_segMan->newNode(nodeValue, nodeKey);
debugC(2, kDebugLevelNodes, "New nodebase at %04x:%04x", PRINT_REG(s->r_acc));