aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2016-10-23 21:35:22 -0400
committerPaul Gilbert2016-10-23 21:35:22 -0400
commit7e5842fd43885ea98a429cf2c1186b6caa5ab645 (patch)
tree155985444a04b34d7b4650a9878d29681e7052ea /engines
parent3852d1406111253a0cf335c49699d862940e0323 (diff)
downloadscummvm-rg350-7e5842fd43885ea98a429cf2c1186b6caa5ab645.tar.gz
scummvm-rg350-7e5842fd43885ea98a429cf2c1186b6caa5ab645.tar.bz2
scummvm-rg350-7e5842fd43885ea98a429cf2c1186b6caa5ab645.zip
TITANIC: Fix showing multiple NPC animations as Doorbot speaks
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/npcs/true_talk_npc.cpp10
1 files changed, 6 insertions, 4 deletions
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;