From bfef0f5a6fabdef5bb42cffd8b078d4511cf2a80 Mon Sep 17 00:00:00 2001 From: md5 Date: Sun, 3 Apr 2011 19:02:14 +0300 Subject: SCI: Fixed fading-related bugs #3267956 and #3041738 --- engines/sci/sound/soundcmd.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines') diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 1e6d0aef87..9ad964b67e 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -325,6 +325,14 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) { return acc; } + // If the current volume of the slot is the same as the target volume, + // return without performing any fading. This fixes the music in room + // 406 in KQ6 (bug #3267956), where the game scripts ask for the background + // music to be played, and then faded to volume 127 (but the music is + // already at volume 127) and subsequently stopped. + if (argc >= 4 && musicSlot->volume == CLIP(argv[1].toUint16(), 0, MUSIC_VOLUME_MAX)) + return acc; + switch (argc) { case 1: // SCI0 // SCI0 fades out all the time and when fadeout is done it will also -- cgit v1.2.3