aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/script.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp
index 6db787bcd0..a76b2a2af6 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -407,8 +407,10 @@ void ScummEngine::getScriptBaseAddress() {
case WIO_FLOBJECT: /* flobject script */
idx = getObjectIndex(ss->number);
- _scriptOrgPointer = getResourceAddress(rtFlObject, _objs[idx].fl_object_index);
- assert(_objs[idx].fl_object_index < _numFlObject);
+ assert(idx != -1);
+ idx = _objs[idx].fl_object_index;
+ _scriptOrgPointer = getResourceAddress(rtFlObject, idx);
+ assert(idx < _numFlObject);
_lastCodePtr = &_baseFLObject[idx];
break;
default: