aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorBen Castricum2017-02-27 16:21:53 +0100
committerEugene Sandulenko2017-07-30 22:10:54 +0200
commit392d8b44ff99d08eabe6007b259d26545f085583 (patch)
treed1f38ea132fd0f21d0509a0b5c5f096c5641ee2f /engines/scumm
parent4668b1655cbb1a53f8ae8ef355f5fae661f675b4 (diff)
downloadscummvm-rg350-392d8b44ff99d08eabe6007b259d26545f085583.tar.gz
scummvm-rg350-392d8b44ff99d08eabe6007b259d26545f085583.tar.bz2
scummvm-rg350-392d8b44ff99d08eabe6007b259d26545f085583.zip
SCUMM: MI2 kill tune 107 on start of next, Fixes bug #1410 / Scabb Island
Fix the "MI2: Two soundtracks playing at once" bug from the forum. It's triggered when the player is moving faster then the scripts expect causing the "stop tune 117" command be executed before the start of the tune. Effectily creating a hanging tune 107. This patch kills the tune when this sitation is detected.
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/imuse/imuse.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp
index 8b892f5fda..78fd821f30 100644
--- a/engines/scumm/imuse/imuse.cpp
+++ b/engines/scumm/imuse/imuse.cpp
@@ -675,6 +675,27 @@ bool IMuseInternal::startSound_internal(int sound, int offset) {
if (_game_id == GID_SAMNMAX && sound == 82 && getSoundStatus_internal(81, false))
ImClearTrigger(81, 1);
+ // Workaround for monkey2 bug #1410 / Scabb Island
+ //
+ // Tunes involved:
+ // 100 - Captain Dread's map
+ // 101 - Woodtick
+ // 107 - Map of Scabb Island
+ //
+ // If you go from Woodtick to the map of Scabb Island tune 107 is added as
+ // trigger on 101 and 101 moves to an outro and stop (triggering start
+ // of 107). Then at Captain Dread tune 107 is stopped and 100 is started.
+ //
+ // If you go quickly enough, the trigger occurs not at the Scabb Island
+ // map but at Captain Dread causing tune 107 not to be stopped.
+ // So we prevent starting 107 if 100 is already running.
+ if (_game_id == GID_MONKEY2 && (sound == 107) && (getSoundStatus_internal(100, true) == 1))
+ return false;
+
+ // In some cases 107 is running and doesn't get killed at Dread's map
+ if (_game_id == GID_MONKEY2 && (sound == 100) && (getSoundStatus_internal(107, true) == 1))
+ IMuseInternal::stopSound_internal(107);
+
player->clear();
player->setOffsetNote(offset);
return player->startSound(sound, driver);