From d8fe05a5fa9de0122aefbd8811d0e1110c7dec3f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 1 Sep 2004 07:59:30 +0000 Subject: Fix incorrect flObject base address computation svn-id: r14854 --- scumm/script.cpp | 6 ++++-- 1 file 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: -- cgit v1.2.3