diff options
author | Paul Gilbert | 2016-05-11 07:32:46 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:39:13 -0400 |
commit | b8a7a98c544eeae453b0b62cffdac7a59f43b737 (patch) | |
tree | b404a84cad2a35c5891a0922400e6007cee8e200 /engines | |
parent | b8c41050211c6b5c25a9e02a767a54b8e1ef55d7 (diff) | |
download | scummvm-rg350-b8a7a98c544eeae453b0b62cffdac7a59f43b737.tar.gz scummvm-rg350-b8a7a98c544eeae453b0b62cffdac7a59f43b737.tar.bz2 scummvm-rg350-b8a7a98c544eeae453b0b62cffdac7a59f43b737.zip |
TITANIC: Bugfixes for vocab loading
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/true_talk/st_vocab.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_string_node.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_string_node.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp index 5135f6466e..a4f5cd851d 100644 --- a/engines/titanic/true_talk/st_vocab.cpp +++ b/engines/titanic/true_talk/st_vocab.cpp @@ -145,7 +145,7 @@ TTword *STVocab::findWord(const TTString &str) { bool flag = false; TTword *word = _pHead; - while (!flag) { + while (word && !flag) { if (_field18 != 3 || strcmp(word->c_str(), str)) { if (word->scanCopy(str, tempNode, _field18)) word = word->_pNext; diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp index b3d3707ee5..95b6465137 100644 --- a/engines/titanic/true_talk/tt_string_node.cpp +++ b/engines/titanic/true_talk/tt_string_node.cpp @@ -84,9 +84,9 @@ void TTstringNode::detach() { _pNext->_pPrior = _pPrior; } -TTstringNode *TTstringNode::getTail() const { +TTstringNode *TTstringNode::getTail() { if (_pNext == nullptr) - return nullptr; + return this; TTstringNode *node = _pNext; while (node->_pNext) diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h index f836889f43..2c6a4e148d 100644 --- a/engines/titanic/true_talk/tt_string_node.h +++ b/engines/titanic/true_talk/tt_string_node.h @@ -32,7 +32,7 @@ private: /** * Returns the final node at the end of the linked list of nodes */ - TTstringNode *getTail() const; + TTstringNode *getTail(); protected: /** * Initializes state for the node |