From 5c7c6ca2a3e930faba8b0f26841093de3a1e97f4 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Thu, 26 Feb 2004 07:31:48 +0000 Subject: Work around music glitch in Monkey Island 2: In the scene where Largo is speaking to Mad Marty, the Woodtick music often resumes way before Largo's theme has finished. With this workaround, it waits until Largo's theme has definitely finished before starting the Woodtick music again. I wouldn't have done it this way if I hadn't been almost positive that it's a script bug, rather than an iMUSE bug. svn-id: r13061 --- scumm/script_v5.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'scumm') diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index 925593738c..cb57dd9478 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -2232,8 +2232,22 @@ void ScummEngine_v5::o5_startMusic() { } void ScummEngine_v5::o5_startSound() { + const byte *oldaddr = _scriptPointer - 1; + int sound = getVarOrDirectByte(PARAM_1); + + // WORKAROUND: In the scene where Largo is talking to Mad Marty, the + // Woodtick music often resumes before Largo's theme has finished. As + // far as I can tell, this is a script bug. + + if (_gameId == GID_MONKEY2 && sound == 110 && _sound->isSoundRunning(151)) { + warning("Delaying Woodtick music until Largo's theme has finished"); + _scriptPointer = oldaddr; + o5_breakHere(); + return; + } + VAR(VAR_MUSIC_TIMER) = 0; - _sound->addSoundToQueue(getVarOrDirectByte(PARAM_1)); + _sound->addSoundToQueue(sound); } void ScummEngine_v5::o5_stopMusic() { -- cgit v1.2.3