diff options
-rw-r--r-- | engines/sci/engine/object.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp index 2875c8b041..a09d530812 100644 --- a/engines/sci/engine/object.cpp +++ b/engines/sci/engine/object.cpp @@ -122,13 +122,19 @@ const Object *Object::getClass(SegManager *segMan) const { int Object::locateVarSelector(SegManager *segMan, Selector slc) const { const Common::Array<uint16> *buf; - const uint varCount = getVarCount(); + uint varCount; - if (getSciVersion() <= SCI_VERSION_2_1_LATE) { +#ifdef ENABLE_SCI32 + if (getSciVersion() == SCI_VERSION_3) { + buf = &_baseVars; + varCount = getVarCount(); + } else { +#else + { +#endif const Object *obj = getClass(segMan); buf = &obj->_baseVars; - } else if (getSciVersion() == SCI_VERSION_3) { - buf = &_baseVars; + varCount = obj->getVarCount(); } for (uint i = 0; i < varCount; i++) |