From ecabacaddd0a89b0aa83c9b176891c5c4f47aafc Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 4 Jun 2014 01:49:31 +0200 Subject: SCUMM: Properly unlock sound resources when reusing sfx slots in AD code. --- engines/scumm/players/player_ad.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/scumm/players') diff --git a/engines/scumm/players/player_ad.cpp b/engines/scumm/players/player_ad.cpp index 7596a3fa7a..fdd62555ff 100644 --- a/engines/scumm/players/player_ad.cpp +++ b/engines/scumm/players/player_ad.cpp @@ -121,6 +121,11 @@ void Player_AD::startSound(int sound) { if (_sfx[channel].resource != -1) { if (_sfx[channel].priority > priority) { return; + } else { + // If we overwrite a channel we will properly stop the old + // sfx slot first. This makes sure that the resource is + // unlocked properly. + stopSfx(&_sfx[channel]); } } -- cgit v1.2.3