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.
This commit is contained in:
NMIError 2020-07-14 21:01:26 +02:00
parent b26514e55b
commit 7642698fd7

@ -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);