diff options
author | Paul Gilbert | 2016-11-02 21:31:14 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-11-02 21:31:14 -0400 |
commit | 8abe97dfdad1fc9b44bded185ff5c5a00fa2f2d3 (patch) | |
tree | 458f35aa71d9f5aa8b54ffa65450eecee0d00d0c | |
parent | 1846ef7850547342b3b0792144d2b94d23492b91 (diff) | |
download | scummvm-rg350-8abe97dfdad1fc9b44bded185ff5c5a00fa2f2d3.tar.gz scummvm-rg350-8abe97dfdad1fc9b44bded185ff5c5a00fa2f2d3.tar.bz2 scummvm-rg350-8abe97dfdad1fc9b44bded185ff5c5a00fa2f2d3.zip |
TITANIC: Parser fixes
-rw-r--r-- | engines/titanic/true_talk/title_engine.cpp | 3 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_concept_node.cpp | 3 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_parser.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_string.cpp | 6 |
4 files changed, 10 insertions, 4 deletions
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp index 079067389d..bfa97e3f92 100644 --- a/engines/titanic/true_talk/title_engine.cpp +++ b/engines/titanic/true_talk/title_engine.cpp @@ -40,7 +40,8 @@ void CTitleEngine::setup(int val1, int val2) { /*------------------------------------------------------------------------*/ -STtitleEngine::STtitleEngine(): CTitleEngine(), _responseP(nullptr) { +STtitleEngine::STtitleEngine(): CTitleEngine(), + _responseP(nullptr), _stream(nullptr) { } STtitleEngine::~STtitleEngine() { diff --git a/engines/titanic/true_talk/tt_concept_node.cpp b/engines/titanic/true_talk/tt_concept_node.cpp index 454ca59971..f6512b3d81 100644 --- a/engines/titanic/true_talk/tt_concept_node.cpp +++ b/engines/titanic/true_talk/tt_concept_node.cpp @@ -29,11 +29,14 @@ namespace Titanic { TTconceptNode::TTconceptNode() : _concept0P(_concepts[0]), _concept1P(_concepts[1]), _concept2P(_concepts[2]), _concept3P(_concepts[3]), _concept4P(_concepts[4]), _concept5P(_concepts[5]), _field18(0), _field1C(0), _nextP(nullptr), _status(0) { + Common::fill(&_concepts[0], &_concepts[6], (TTconcept *)nullptr); } TTconceptNode::TTconceptNode(const TTconceptNode &src) : _concept0P(_concepts[0]), _concept1P(_concepts[1]), _concept2P(_concepts[2]), _concept3P(_concepts[3]), _concept4P(_concepts[4]), _concept5P(_concepts[5]), _field18(0), _field1C(0), _nextP(nullptr), _status(0) { + Common::fill(&_concepts[0], &_concepts[6], (TTconcept *)nullptr); + if (src._status) { _status = SS_5; } else { diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index d67f5235c4..dc056218a9 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -489,7 +489,7 @@ int TTparser::findFrames(TTsentence *sentence) { break; TTword *srcWord = nullptr; - TTword *word = _owner->_vocab->getWord(wordString, &word); + TTword *word = _owner->_vocab->getWord(wordString, &srcWord); sentence->storeVocabHit(srcWord); if (!word && ctr == 1) { diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp index 198a8c2e80..43910fc823 100644 --- a/engines/titanic/true_talk/tt_string.cpp +++ b/engines/titanic/true_talk/tt_string.cpp @@ -111,7 +111,7 @@ TTstring TTstring::tokenize(const char *delim) { const char *strP = _data->_string.c_str(); const char *splitP = nullptr, *chP; - for (const char *d = delim; d; ++d) { + for (const char *d = delim; *d; ++d) { chP = strchr(strP, *d); if (chP && (splitP == nullptr || chP < splitP)) splitP = chP; @@ -122,7 +122,9 @@ TTstring TTstring::tokenize(const char *delim) { _data->_string = CString(splitP + 1); return result; } else { - return TTstring(); + TTstring result(strP); + _data->_string = CString(); + return result; } } |