diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 1b3f18694e..f31a43cec4 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -950,11 +950,21 @@ void debugPropertyAccess(Object *obj, reg_t objp, unsigned int index, reg_t curV const Object *var_container = obj; if (!obj->isClass() && getSciVersion() != SCI_VERSION_3) var_container = segMan->getObject(obj->getSuperClassSelector()); - if ((index >> 1) >= var_container->getVarCount()) { - // TODO: error, warning, debug? - return; + + uint16 varSelector; + if (getSciVersion() == SCI_VERSION_3) { + varSelector = index; + } else { + index >>= 1; + + if (index >= var_container->getVarCount()) { + // TODO: error, warning, debug? + return; + } + + varSelector = var_container->getVarSelector(index); } - uint16 varSelector = var_container->getVarSelector(index >> 1); + if (g_sci->checkSelectorBreakpoint(breakpointType, objp, varSelector)) { // checkSelectorBreakpoint has already triggered the breakpoint. // We just output the relevant data here. |