From 59d6feb9f89be24ffe27d24cc07c463dc7bfded0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 12 Feb 2017 23:06:13 -0500 Subject: TITANIC: Fix threshold testing for instrument animations --- engines/titanic/sound/music_room_handler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/titanic/sound/music_room_handler.cpp b/engines/titanic/sound/music_room_handler.cpp index fca1fd5460..76d7043d0c 100644 --- a/engines/titanic/sound/music_room_handler.cpp +++ b/engines/titanic/sound/music_room_handler.cpp @@ -253,8 +253,9 @@ void CMusicRoomHandler::updateInstruments() { uint ticks = g_vm->_events->getTicksCount() - _soundStartTicks; double time = (double)ticks * 0.001 - 0.6; + double threshold = _animTime[instrument] - ins->_animTime; - if (time >= (ins->_animTime - _animTime[instrument])) { + if (time >= threshold) { _animTime[instrument] += getAnimDuration(instrument, _position[instrument]); const CValuePair &vp = (*_songs[instrument])[_position[instrument]]; -- cgit v1.2.3