aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/script.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-05-27 17:41:20 +0000
committerMartin Kiewitz2010-05-27 17:41:20 +0000
commit453d13dc2d2bec3a4d7cc4395bf98bd2103c5ff8 (patch)
treea52cada57a5ecac70c1619d68b28962120baf21a /engines/sci/engine/script.cpp
parent5f5dcbad47c3f120541c59a141e84bb8aed5184d (diff)
downloadscummvm-rg350-453d13dc2d2bec3a4d7cc4395bf98bd2103c5ff8.tar.gz
scummvm-rg350-453d13dc2d2bec3a4d7cc4395bf98bd2103c5ff8.tar.bz2
scummvm-rg350-453d13dc2d2bec3a4d7cc4395bf98bd2103c5ff8.zip
SCI: fixing -propDict- selector on instances to contain -propDict- of the corresponding class - fixes sq4cd/room 381 talk-clicking on robot - thx to waltervn & wjp
svn-id: r49263
Diffstat (limited to 'engines/sci/engine/script.cpp')
-rw-r--r--engines/sci/engine/script.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index 9bbb7738e9..e0bcd632cc 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -256,6 +256,16 @@ void SegManager::scriptInitialiseObjectsSci11(SegmentId seg) {
obj->setSuperClassSelector(
getClassAddress(obj->getSuperClassSelector().offset, SCRIPT_GET_LOCK, NULL_REG));
+ // If object is instance, get -propDict- from class and set it for this object
+ // This is needed for ::isMemberOf() to work.
+ // Example testcase - room 381 of sq4cd - if isMemberOf() doesn't work, talk-clicks on the robot will act like
+ // clicking on ego
+ if (!obj->isClass()) {
+ reg_t classObject = obj->getSuperClassSelector();
+ Object *classObj = getObject(classObject);
+ obj->setPropDictSelector(classObj->getPropDictSelector());
+ }
+
// Set the -classScript- selector to the script number.
// FIXME: As this selector is filled in at run-time, it is likely
// that it is supposed to hold a pointer. The Obj::isKindOf method