diff options
-rw-r--r-- | engines/titanic/npcs/bellbot.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/true_talk/bellbot_script.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_npc_script.cpp | 5 |
3 files changed, 6 insertions, 5 deletions
diff --git a/engines/titanic/npcs/bellbot.cpp b/engines/titanic/npcs/bellbot.cpp index 2514d20df6..1326655299 100644 --- a/engines/titanic/npcs/bellbot.cpp +++ b/engines/titanic/npcs/bellbot.cpp @@ -238,8 +238,6 @@ bool CBellBot::NPCPlayTalkingAnimationMsg(CNPCPlayTalkingAnimationMsg *msg) { bool CBellBot::TimerMsg(CTimerMsg *msg) { if (msg->_action == "SummonDoorbot") { - CTrueTalkNPC::TimerMsg(msg); - } else { CRoomItem *room = getRoom(); if (room) { CSummonBotMsg botMsg; @@ -249,6 +247,8 @@ bool CBellBot::TimerMsg(CTimerMsg *msg) { } _npcFlags &= ~NPCFLAG_20000; + } else { + CTrueTalkNPC::TimerMsg(msg); } return true; diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp index 038285ec8d..9f9b6fa267 100644 --- a/engines/titanic/true_talk/bellbot_script.cpp +++ b/engines/titanic/true_talk/bellbot_script.cpp @@ -527,7 +527,7 @@ int BellbotScript::handleQuote(const TTroomScript *roomScript, const TTsentence int BellbotScript::updateState(uint oldId, uint newId, int index) { if (!getValue(25)) { - newId = 202043 - getValue(1) <= 2 ? 994 : 0; + newId = 202043 - (getValue(1) <= 2 ? 994 : 0); CTrueTalkManager::setFlags(25, 1); } diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp index 74e2f4f66b..bfb97c8c37 100644 --- a/engines/titanic/true_talk/tt_npc_script.cpp +++ b/engines/titanic/true_talk/tt_npc_script.cpp @@ -338,12 +338,13 @@ uint TTnpcScript::getRangeValue(uint id) { case SF_RANDOM: { uint count = range->_values.size(); - uint index = getRandomNumber(count) - 1; + int index = (int)getRandomNumber(count) - 1; if (count > 1 && range->_values[index] == range->_priorIndex) { for (int retry = 0; retry < 8 && index != range->_priorIndex; ++retry) - index = getRandomNumber(count) - 1; + index = (int)getRandomNumber(count) - 1; } + assert(index >= 0); range->_priorIndex = index; return range->_values[index]; } |