From 88f1a4e27cc07302334799dad5526d5a9d18281a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 2 Jun 2003 01:45:03 +0000 Subject: fix for indy3 VGA script bug (bug #743314) svn-id: r8259 --- scumm/script_v5.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'scumm') diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index 55c96be729..2eb939b018 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -579,20 +579,31 @@ void Scumm_v5::o5_breakHere() { void Scumm_v5::o5_chainScript() { int vars[16]; - int data; + int script; int cur; - data = getVarOrDirectByte(0x80); + script = getVarOrDirectByte(0x80); getWordVararg(vars); cur = _currentScript; + // FIXME: Work around a bug in script 33 in Indy3 VGA. That script is + // used for the fist fights in the Zeppeling. It uses Local[5], even + // though that is never set to any value. But script 33 is called + // via chainScript by script 32, and in there Local[5] is defined to + // the actor ID of the opposing soldier. So, we copy that value + // over to the Local[5] variable of script 33. + // See also bug #743314. + if (_gameId == GID_INDY3_256 && vm.slot[cur].number == 32 && script == 33) { + vars[5] = vm.localvar[cur][5]; + } + vm.slot[cur].number = 0; vm.slot[cur].status = 0; _currentScript = 0xFF; - runScript(data, vm.slot[cur].freezeResistant, vm.slot[cur].recursive, vars); + runScript(script, vm.slot[cur].freezeResistant, vm.slot[cur].recursive, vars); } void Scumm_v5::o5_cursorCommand() { -- cgit v1.2.3