From a709a4231937fef823352cffb7146a94d9f8cccf Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Tue, 3 Jan 2012 22:58:25 +0100 Subject: SCUMM: fix ScummEngine_v0::o_stopCurrentScript() --- engines/scumm/script_v0.cpp | 9 +-------- engines/scumm/script_v2.cpp | 10 +++++----- engines/scumm/scumm_v2.h | 1 + 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp index 07923dea6a..2bbde617ad 100644 --- a/engines/scumm/script_v0.cpp +++ b/engines/scumm/script_v0.cpp @@ -501,14 +501,7 @@ void ScummEngine_v0::drawSentence() { } void ScummEngine_v0::o_stopCurrentScript() { - int script; - - script = vm.slot[_currentScript].number; - - if (_currentScript != 0 && vm.slot[_currentScript].number == script) - stopObjectCode(); - else - stopScript(script); + stopScriptCommon(0); } void ScummEngine_v0::o_loadSound() { diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp index 76f6b02eb7..003bafa27e 100644 --- a/engines/scumm/script_v2.cpp +++ b/engines/scumm/script_v2.cpp @@ -1190,11 +1190,7 @@ void ScummEngine_v2::o2_startScript() { runScript(script, 0, 0, 0); } -void ScummEngine_v2::o2_stopScript() { - int script; - - script = getVarOrDirectByte(PARAM_1); - +void ScummEngine_v2::stopScriptCommon(int script) { if (_game.id == GID_MANIAC && _roomResource == 26 && vm.slot[_currentScript].number == 10001) { // FIXME: Nasty hack for bug #915575 // Don't let the exit script for room 26 stop the script (116), when @@ -1215,6 +1211,10 @@ void ScummEngine_v2::o2_stopScript() { stopScript(script); } +void ScummEngine_v2::o2_stopScript() { + stopScriptCommon(getVarOrDirectByte(PARAM_1)); +} + void ScummEngine_v2::o2_panCameraTo() { panCameraTo(getVarOrDirectByte(PARAM_1) * V12_X_MULTIPLIER, 0); } diff --git a/engines/scumm/scumm_v2.h b/engines/scumm/scumm_v2.h index 1f41283852..a4da4fb2dc 100644 --- a/engines/scumm/scumm_v2.h +++ b/engines/scumm/scumm_v2.h @@ -85,6 +85,7 @@ protected: void ifNotStateCommon(byte type); void setStateCommon(byte type); void clearStateCommon(byte type); + void stopScriptCommon(int script); virtual void resetSentence(bool walking); void setUserState(byte state); -- cgit v1.2.3