From 371cfa810f5ceaa7f05a1b0fd670dfa0f0ace5e1 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 22 Feb 2004 16:08:13 +0000 Subject: This should fix zak lotto bug correctly. svn-id: r12989 --- scumm/intern.h | 1 + scumm/script_v2.cpp | 18 ++++++++++++++++-- scumm/script_v5.cpp | 8 -------- 3 files changed, 17 insertions(+), 10 deletions(-) (limited to 'scumm') diff --git a/scumm/intern.h b/scumm/intern.h index 34ef531c36..504d35bd9c 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -289,6 +289,7 @@ protected: void o2_setState04(); void o2_setState08(); void o2_startScript(); + void o2_stopScript(); void o2_subtract(); void o2_subIndirect(); void o2_switchCostumeSet(); diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index f1cc18b4ab..839aa00875 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -158,7 +158,7 @@ void ScummEngine_v2::setupOpcodes() { /* 60 */ OPCODE(o2_cursorCommand), OPCODE(o2_putActor), - OPCODE(o5_stopScript), + OPCODE(o2_stopScript), OPCODE(o5_getActorFacing), /* 64 */ OPCODE(o2_loadRoomWithEgo), @@ -318,7 +318,7 @@ void ScummEngine_v2::setupOpcodes() { /* E0 */ OPCODE(o2_cursorCommand), OPCODE(o2_putActor), - OPCODE(o5_stopScript), + OPCODE(o2_stopScript), OPCODE(o5_getActorFacing), /* E4 */ OPCODE(o2_loadRoomWithEgo), @@ -1114,6 +1114,20 @@ void ScummEngine_v2::o2_startScript() { runScript(script, 0, 0, 0); } +void ScummEngine_v2::o2_stopScript() { + int script; + + script = getVarOrDirectByte(PARAM_1); + + if (script == 0) + script = vm.slot[_currentScript].number; + + if (_currentScript != 0) { + if (vm.slot[_currentScript].number == script) + stopScript(script); + } +} + void ScummEngine_v2::o2_panCameraTo() { panCameraTo(getVarOrDirectByte(PARAM_1) * 8, 0); } diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index c5debfa771..925593738c 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -2308,14 +2308,6 @@ void ScummEngine_v5::o5_stopScript() { script = getVarOrDirectByte(PARAM_1); - if ((_gameId == GID_ZAK) && (_roomResource == 7) && (vm.slot[_currentScript].number == 10001)) { - // FIXME: Nasty hack for bug #771499 - // Don't let the exit script for room 7 stop the buy script (24), - // switching to the number selection keypad (script 15) - if ((script == 24) && isScriptRunning(15)) - return; - } - if (!script) stopObjectCode(); else -- cgit v1.2.3