[Scummvm-cvs-logs] SF.net SVN: scummvm:[49263] scummvm/trunk/engines/sci/engine
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Thu May 27 19:41:20 CEST 2010
Revision: 49263
http://scummvm.svn.sourceforge.net/scummvm/?rev=49263&view=rev
Author: m_kiewitz
Date: 2010-05-27 17:41:20 +0000 (Thu, 27 May 2010)
Log Message:
-----------
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
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/script.cpp
scummvm/trunk/engines/sci/engine/segment.h
Modified: scummvm/trunk/engines/sci/engine/script.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/script.cpp 2010-05-27 12:00:20 UTC (rev 49262)
+++ scummvm/trunk/engines/sci/engine/script.cpp 2010-05-27 17:41:20 UTC (rev 49263)
@@ -256,6 +256,16 @@
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
Modified: scummvm/trunk/engines/sci/engine/segment.h
===================================================================
--- scummvm/trunk/engines/sci/engine/segment.h 2010-05-27 12:00:20 UTC (rev 49262)
+++ scummvm/trunk/engines/sci/engine/segment.h 2010-05-27 17:41:20 UTC (rev 49263)
@@ -226,6 +226,9 @@
reg_t getNameSelector() const { return _variables[_offset + 3]; }
void setNameSelector(reg_t value) { _variables[_offset + 3] = value; }
+ reg_t getPropDictSelector() const { return _variables[2]; }
+ void setPropDictSelector(reg_t value) { _variables[2] = value; }
+
reg_t getClassScriptSelector() const { return _variables[4]; }
void setClassScriptSelector(reg_t value) { _variables[4] = value; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list