aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Gunkel2012-01-03 22:58:25 +0100
committerTobias Gunkel2012-02-11 08:02:34 +0100
commita709a4231937fef823352cffb7146a94d9f8cccf (patch)
treecd464ca721c02c14987fe9210a8797e588b00b1b
parenta79f224c23f1b0fa4d9850a032e0adc0d72619f7 (diff)
downloadscummvm-rg350-a709a4231937fef823352cffb7146a94d9f8cccf.tar.gz
scummvm-rg350-a709a4231937fef823352cffb7146a94d9f8cccf.tar.bz2
scummvm-rg350-a709a4231937fef823352cffb7146a94d9f8cccf.zip
SCUMM: fix ScummEngine_v0::o_stopCurrentScript()
-rw-r--r--engines/scumm/script_v0.cpp9
-rw-r--r--engines/scumm/script_v2.cpp10
-rw-r--r--engines/scumm/scumm_v2.h1
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);