diff options
| -rw-r--r-- | scumm/intern.h | 1 | ||||
| -rw-r--r-- | scumm/script_v2.cpp | 18 | ||||
| -rw-r--r-- | scumm/script_v5.cpp | 8 | 
3 files changed, 17 insertions, 10 deletions
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  | 
