diff options
author | Paul Gilbert | 2016-11-03 20:45:08 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-11-03 20:45:08 -0400 |
commit | c3e026564a0bf3805fc2c74de7062f2bad435b75 (patch) | |
tree | 954ffdeabe4481eface19d1820073ec076f24064 | |
parent | ab12211d678fb1b08ff4ec0a71fc09e8a6888f8d (diff) | |
download | scummvm-rg350-c3e026564a0bf3805fc2c74de7062f2bad435b75.tar.gz scummvm-rg350-c3e026564a0bf3805fc2c74de7062f2bad435b75.tar.bz2 scummvm-rg350-c3e026564a0bf3805fc2c74de7062f2bad435b75.zip |
TITANIC: Fix choosing correct vocab matches for words
-rw-r--r-- | engines/titanic/true_talk/tt_parser.cpp | 6 | ||||
-rw-r--r-- | 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();
|