[Scummvm-git-logs] scummvm master -> 7b61e71ae5a647955891724fb001fee6a6cc2a9d

dreammaster dreammaster at scummvm.org
Thu Jul 20 00:56:09 CEST 2017


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:
7b61e71ae5 TITANIC: Fix quote searches done by all the bots


Commit: 7b61e71ae5a647955891724fb001fee6a6cc2a9d
    https://github.com/scummvm/scummvm/commit/7b61e71ae5a647955891724fb001fee6a6cc2a9d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-07-19T18:56:04-04:00

Commit Message:
TITANIC: Fix quote searches done by all the bots

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/tt_npc_script.cpp


diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index c0d879b..ae4104c 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -205,7 +205,7 @@ int BarbotScript::process(const TTroomScript *roomScript, const TTsentence *sent
 	CTrueTalkManager::setFlags(33, getValue(33) - 1);
 	CTrueTalkManager::setFlags(34, getValue(34) - 1);
 
-	TTtreeResult treeResult;
+	TTtreeResult treeResult[32];
 	int val34 = getState();
 	setState(0);
 
@@ -303,7 +303,7 @@ int BarbotScript::process(const TTroomScript *roomScript, const TTsentence *sent
 			return applySentenceIds(getDialogueId(250526), 16);
 		} else {
 			if (g_vm->_trueTalkManager->_quotesTree.search(
-					sentence->_normalizedLine.c_str(), TREE_3, &treeResult, 0, nullptr) != -1) {
+					sentence->_normalizedLine.c_str(), TREE_3, &treeResult[0], 0, nullptr) != -1) {
 				uint newId = getDialogueId(250526);
 				return applySentenceIds(newId, 16);
 			}
@@ -358,7 +358,7 @@ int BarbotScript::process(const TTroomScript *roomScript, const TTsentence *sent
 		break;
 	case 26:
 		if (g_vm->_trueTalkManager->_quotesTree.search(
-				sentence->_normalizedLine.c_str(), TREE_3, &treeResult, 0, nullptr) != -1)
+				sentence->_normalizedLine.c_str(), TREE_3, &treeResult[0], 0, nullptr) != -1)
 			return applySentenceIds(getDialogueId(251899), 26);
 		break;
 
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index b1d6a91..4fcf329 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -259,9 +259,9 @@ int DoorbotScript::process(const TTroomScript *roomScript, const TTsentence *sen
 			break;
 
 		case 16: {
-			TTtreeResult treeResult;
+			TTtreeResult treeResult[32];
 			if (g_vm->_trueTalkManager->_quotesTree.search(sentence->_normalizedLine.c_str(),
-					TREE_3, &treeResult, 0, nullptr) != -1)
+					TREE_3, &treeResult[0], 0, nullptr) != -1)
 				return setResponse(getDialogueId(221380), 0);
 			break;
 		}
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index c77885e..18f32a7 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -93,7 +93,7 @@ int LiftbotScript::process(const TTroomScript *roomScript, const TTsentence *sen
 	checkItems(roomScript, sentence);
 	int currState = getState();
 	int sentMode = sentence->_category;
-	TTtreeResult treeResult;
+	TTtreeResult treeResult[32];
 
 	if (currState) {
 		setState(0);
@@ -134,7 +134,7 @@ int LiftbotScript::process(const TTroomScript *roomScript, const TTsentence *sen
 
 		case 9:
 			if (sentMode == 10 || g_vm->_trueTalkManager->_quotesTree.search(
-				sentence->_normalizedLine.c_str(), TREE_2, &treeResult, 0, 0) != -1)
+				sentence->_normalizedLine.c_str(), TREE_2, &treeResult[0], 0, 0) != -1)
 				return addDialogueAndState(getDialogueId(210970), 9);
 			break;
 
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 86ed871..f12d02c 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -777,11 +777,11 @@ int TTnpcScript::processEntries(const TTsentenceEntries *entries, uint entryCoun
 
 bool TTnpcScript::defaultProcess(const TTroomScript *roomScript, const TTsentence *sentence) {
 	uint remainder;
-	TTtreeResult results[32];
+	TTtreeResult treeResult[32];
 	const TTstring &line = sentence->_normalizedLine;
 
 	uint tagId = g_vm->_trueTalkManager->_quotes.find(line.c_str());
-	int val = g_vm->_trueTalkManager->_quotesTree.search(line.c_str(), TREE_1, results, tagId, &remainder);
+	int val = g_vm->_trueTalkManager->_quotesTree.search(line.c_str(), TREE_1, &treeResult[0], tagId, &remainder);
 
 	if (val > 0) {
 		if (!handleQuote(roomScript, sentence, val, tagId, remainder))





More information about the Scummvm-git-logs mailing list