SCUMM: MI2 kill tune 113 on start of next, Fixes bug #1410 / Booty Island

Fix the "MI2: Two soundtracks playing at once" bug from the bug tracker.
It's triggered when the player enters the kiosk for the second time and
leaves before tune 113 is started.
This commit is contained in:
Ben Castricum 2017-06-16 08:16:30 +02:00 committed by Eugene Sandulenko
parent 392d8b44ff
commit d58f594755

View File

@ -696,6 +696,23 @@ bool IMuseInternal::startSound_internal(int sound, int offset) {
if (_game_id == GID_MONKEY2 && (sound == 100) && (getSoundStatus_internal(107, true) == 1))
IMuseInternal::stopSound_internal(107);
// Workaround for monkey2 bug #1410 / Booty Island
//
// Tunes involved
// 100 - Captain Dread's map
// 113 - Guard Kiosk / Mardi Grass
// 115 - Map of Booty Island / Ville de la Booty
// 118 - Ville de la Booty
//
// When you enter the Guard Kiosk tune 113 is added as trigger on song
// 115. Then if you leave, 113 is stopped and 115 is started again.
// If you leave quickly enough, the trigger occurs on the map and tune
// 113 will not stop.
// We kill 113 on entry of one of the other locations (Captain Dread
// or Ville de la Booty) because tune 115 is not always started.
if (_game_id == GID_MONKEY2 && (sound == 100 || sound == 115 || sound == 118) && (getSoundStatus_internal(113, true) == 1))
IMuseInternal::stopSound_internal(113);
player->clear();
player->setOffsetNote(offset);
return player->startSound(sound, driver);