aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-02 07:54:44 -0400
committerPaul Gilbert2016-09-02 07:54:44 -0400
commit0f30caff932ddacd26ab71c8097ee2eb225633cc (patch)
tree10a0e3ab4ac5736f3330ccc34d73cebd61579067 /engines
parentbb2168fe9cc195ec51c2566ce537f2d1c83af17d (diff)
downloadscummvm-rg350-0f30caff932ddacd26ab71c8097ee2eb225633cc.tar.gz
scummvm-rg350-0f30caff932ddacd26ab71c8097ee2eb225633cc.tar.bz2
scummvm-rg350-0f30caff932ddacd26ab71c8097ee2eb225633cc.zip
TITANIC: Minor fix and cleanup for NPC talking startup
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/true_talk/script_handler.cpp21
-rw-r--r--engines/titanic/true_talk/tt_npc_script.cpp9
2 files changed, 14 insertions, 16 deletions
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 64e789a4b9..f434822870 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 280894c05a..a3bed4400c 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;