[Scummvm-git-logs] scummvm master -> 73030bd42f3bc3fb21bf44a9b0cb26e0f4b10e6e

dreammaster dreammaster at scummvm.org
Mon Nov 7 04:31:33 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
73030bd42f TITANIC: Fix BellBot's intro speech


Commit: 73030bd42f3bc3fb21bf44a9b0cb26e0f4b10e6e
    https://github.com/scummvm/scummvm/commit/73030bd42f3bc3fb21bf44a9b0cb26e0f4b10e6e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-11-06T22:31:27-05:00

Commit Message:
TITANIC: Fix BellBot's intro speech

Changed paths:
    engines/titanic/npcs/bellbot.cpp
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/tt_npc_script.cpp



diff --git a/engines/titanic/npcs/bellbot.cpp b/engines/titanic/npcs/bellbot.cpp
index 2514d20..1326655 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 038285e..9f9b6fa 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 74e2f4f..bfb97c8 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];
 	}





More information about the Scummvm-git-logs mailing list