[Scummvm-git-logs] scummvm master -> 0f30caff932ddacd26ab71c8097ee2eb225633cc

dreammaster dreammaster at scummvm.org
Fri Sep 2 13:54:57 CEST 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:
0f30caff93 TITANIC: Minor fix and cleanup for NPC talking startup


Commit: 0f30caff932ddacd26ab71c8097ee2eb225633cc
    https://github.com/scummvm/scummvm/commit/0f30caff932ddacd26ab71c8097ee2eb225633cc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-09-02T07:54:44-04:00

Commit Message:
TITANIC: Minor fix and cleanup for NPC talking startup

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/tt_npc_script.cpp



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 64e789a..f434822 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -60,19 +60,18 @@ ScriptChangedResult CScriptHandler::scriptChanged(TTroomScript *roomScript, TTnp
 	if (result == SCR_1)
 		result = npcScript->notifyScript(roomScript, dialogueId);
 
-	if (result != SCR_3 && result != SCR_4)
-		return result;
+	if (dialogueId == 3 || dialogueId == 4) {
+		delete _concept1P;
+		delete _concept2P;
+		delete _concept3P;
+		delete _concept4P;
+		_concept1P = nullptr;
+		_concept2P = nullptr;
+		_concept3P = nullptr;
+		_concept4P = nullptr;
+	}
 
 	++_inputCtr;
-	delete _concept1P;
-	delete _concept2P;
-	delete _concept3P;
-	delete _concept4P;
-	_concept1P = nullptr;
-	_concept2P = nullptr;
-	_concept3P = nullptr;
-	_concept4P = nullptr;
-
 	return result;
 }
 
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 280894c..a3bed44 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -634,13 +634,12 @@ uint TTnpcScript::getDialogueId(uint tagId) {
 		}
 	}
 
-	uint oldTagId = tagId;
 	tagId = getRangeValue(tagId);
-	if (tagId != oldTagId)
+	if (tagId != origId)
 		tagId = getRangeValue(tagId);
 
-	oldTagId = getDialsBitset();
-	uint newId = updateState(origId, tagId, oldTagId);
+	uint dialBits = getDialsBitset();
+	uint newId = updateState(origId, tagId, dialBits);
 	if (!newId)
 		return 0;
 
@@ -654,7 +653,7 @@ uint TTnpcScript::getDialogueId(uint tagId) {
 		if (tableP->_id == newId)
 			break;
 	}
-	uint newVal = tableP->_values[oldTagId];
+	uint newVal = tableP->_values[dialBits];
 
 	// First slot dialogue Ids
 	idx = 0;





More information about the Scummvm-git-logs mailing list