From 077acc5575a1918850e38df06d72579583f55053 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 23 Sep 2011 17:41:30 +0300 Subject: SCI: Fixed bug #3413301 - "SCI: KQ6CD: Game stops responding at the bookworm" --- engines/sci/sound/soundcmd.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'engines/sci/sound') diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index d4cff7614c..e73df69375 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -130,8 +130,14 @@ reg_t SoundCommandParser::kDoSoundPlay(int argc, reg_t *argv, reg_t acc) { void SoundCommandParser::processPlaySound(reg_t obj) { MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { - warning("kDoSound(play): Slot not found (%04x:%04x)", PRINT_REG(obj)); - return; + warning("kDoSound(play): Slot not found (%04x:%04x), initializing it manually", PRINT_REG(obj)); + // The sound hasn't been initialized for some reason, so initialize it here. + // Happens in KQ6, room 460, when giving the creature to the bookwork (the + // bookworm's child). Fixes bug #3413301. + processInitSound(obj); + musicSlot = _music->getSlot(obj); + if (!musicSlot) + error("Failed to initialize uninitialized sound slot"); } int resourceId = getSoundResourceId(obj); -- cgit v1.2.3