From 7e5842fd43885ea98a429cf2c1186b6caa5ab645 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 23 Oct 2016 21:35:22 -0400 Subject: TITANIC: Fix showing multiple NPC animations as Doorbot speaks --- engines/titanic/npcs/true_talk_npc.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp index 9a8cd16799..55666a21a9 100644 --- a/engines/titanic/npcs/true_talk_npc.cpp +++ b/engines/titanic/npcs/true_talk_npc.cpp @@ -99,8 +99,10 @@ bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMs ++_field100; if (!(_npcFlags & NPCFLAG_8)) { + // Stop any previous animation if (_speechTimerId) - stopTimer(_speechTimerId); + stopAnimTimer(_speechTimerId); + _speechTimerId = 0; _speechDuration = msg->_speechDuration; _startTicks = getTicksCount(); @@ -200,7 +202,7 @@ bool CTrueTalkNPC::NPCPlayAnimationMsg(CNPCPlayAnimationMsg *msg) { index = getRandomNumber(count - 1); } while (getClipDuration(msg->_names[index]) > msg->_maxDuration && --tries); - if (tries) { + if (!tries) { // Sequentially go through the clips to find any below the maximum index = 0; for (int idx = 0; idx < count; ++idx) { @@ -211,9 +213,9 @@ bool CTrueTalkNPC::NPCPlayAnimationMsg(CNPCPlayAnimationMsg *msg) { } } - playClip(msg->_names[index], MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT); + playClip(msg->_names[index], MOVIE_NOTIFY_OBJECT); } else { - playClip(msg->_names[getRandomNumber(count - 1)]); + playClip(msg->_names[getRandomNumber(count - 1)], MOVIE_NOTIFY_OBJECT); } return true; -- cgit v1.2.3