From 7642698fd7ba43f014b4bea259aea8fb9acaf4eb Mon Sep 17 00:00:00 2001 From: NMIError Date: Tue, 14 Jul 2020 21:01:26 +0200 Subject: [PATCH] LURE: Fix door sounds ScummVM did not seem to trigger door opening and closing sounds, f.e. the cell door at the start of the game. The checks in the roomExitAnimHandler compared hotspot IDs to room numbers, which are different sets of IDs AFAICT. Also, the door opening part would decrease the frame counter first, then compare to the set destination frame. The opening sound should often be triggered at the start of the animation, but because the frame counter is decreased first, it does not trigger at the first frame. I moved the frame counter decrease after the check to fix this. --- engines/lure/hotspots.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 2aa08382a0e..8baf0685fe7 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -2909,21 +2909,21 @@ void HotspotTickHandlers::roomExitAnimHandler(Hotspot &h) { h.setOccupied(true); ++rs.currentFrame; - if ((rs.currentFrame == rs.destFrame) && (h.hotspotId() == room.roomNumber())) + if ((rs.currentFrame == rs.destFrame) && (h.roomNumber() == room.roomNumber())) Sound.addSound(rs.closeSound); } else if ((rec->blocked == 0) && (rs.currentFrame != 0)) { // Opening the door h.setOccupied(false); - --rs.currentFrame; - if ((rs.currentFrame == rs.destFrame) && (h.hotspotId() == room.roomNumber())) { + if ((rs.currentFrame == rs.destFrame) && (h.roomNumber() == room.roomNumber())) { Sound.addSound(rs.openSound); // If in the outside village, trash reverb if (fields.getField(AREA_FLAG) == 1) Sound.musicInterface_TrashReverb(); } + --rs.currentFrame; } h.setFrameNumber(rs.currentFrame);