diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 1e6d0aef87..33be8f4bca 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -318,6 +318,9 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) { int volume = musicSlot->volume; + // Reset hold so that the song can actually stop + musicSlot->hold = -1; + // If sound is not playing currently, set signal directly if (musicSlot->status != kSoundPlaying) { debugC(kDebugLevelSound, "kDoSound(fade): %04x:%04x fading requested, but sound is currently not playing", PRINT_REG(obj)); @@ -531,6 +534,12 @@ reg_t SoundCommandParser::kDoSoundSetHold(int argc, reg_t *argv, reg_t acc) { return acc; } + // Is the song being faded? If yes, don't set a hold value, otherwise the + // song will never actually stop. Fixes bug #3106107. + if (musicSlot->fadeStep && argv[1].toSint16() != -1) { + warning("kDoSound(setHold): Attempt to set a hold value (%d) to a song being faded, ignoring", argv[1].toSint16()); + return acc; + } // Set the special hold marker ID where the song should be looped at. musicSlot->hold = argv[1].toSint16(); return acc; |