From c3e026564a0bf3805fc2c74de7062f2bad435b75 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 3 Nov 2016 20:45:08 -0400 Subject: TITANIC: Fix choosing correct vocab matches for words --- engines/titanic/true_talk/tt_parser.cpp | 6 +++--- engines/titanic/true_talk/tt_vocab.cpp | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index dc056218a9..f69c0c7c8f 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -482,7 +482,7 @@ int TTparser::findFrames(TTsentence *sentence) { TTstring *line = sentence->_normalizedLine.copy(); TTstring wordString; int status = 0; - for (int ctr = 1; !status; ++ctr) { + for (int ctr = 1; status <= 1; ++ctr) { // Keep stripping words off the start of the passed input wordString = line->tokenize(" \n"); if (wordString.empty()) @@ -496,7 +496,7 @@ int TTparser::findFrames(TTsentence *sentence) { word = new TTword(wordString, WC_UNKNOWN, 0); } - for (TTword *currP = word; currP && !status; currP = currP->_nextP) + for (TTword *currP = word; currP && status <= 1; currP = currP->_nextP) status = processRequests(currP); word->deleteSiblings(); @@ -514,7 +514,7 @@ int TTparser::findFrames(TTsentence *sentence) { int TTparser::loadRequests(TTword *word) { int status = 0; - if (word->_tag != MKTAG('Z', 'Z', 'Z', 'T')) + if (word->_tag != MKTAG('Z', 'Z', 'Z', '[')) addNode(word->_tag); switch (word->_wordClass) { diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp index 062a6b65c0..785f33a470 100644 --- a/engines/titanic/true_talk/tt_vocab.cpp +++ b/engines/titanic/true_talk/tt_vocab.cpp @@ -196,10 +196,12 @@ TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const { TTword *newWord = nullptr; TTword *vocabP; - if (!Common::isDigit(c)) { + if (Common::isDigit(c)) { + // Number vocabP = _headP; newWord = new TTword(str, WC_ABSTRACT, 300); } else { + // Standard word for (vocabP = _headP; vocabP && !newWord; vocabP = vocabP->_nextP) { if (_vocabMode == 3 && !strcmp(str.c_str(), vocabP->c_str())) { newWord = vocabP->copy(); -- cgit v1.2.3