From e58dad8bb6f50c160de4465551abbe877b673360 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 3 Nov 2016 23:04:58 -0400 Subject: TITANIC: Parser fixes for using unrecognised words --- engines/titanic/support/font.cpp | 2 +- engines/titanic/true_talk/tt_parser.cpp | 6 ++++-- engines/titanic/true_talk/tt_vocab.cpp | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'engines/titanic') diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp index 7bcac9ba08..b91a7ec728 100644 --- a/engines/titanic/support/font.cpp +++ b/engines/titanic/support/font.cpp @@ -90,7 +90,7 @@ int STFont::getTextBounds(const CString &str, int maxWidth, Point *sizeOut) cons strP += 4; } else { if (*strP == ' ') { - // Check fo rline wrapping + // Check for line wrapping checkLineWrap(textSize, maxWidth, strP); } diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index f69c0c7c8f..1045416397 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -499,8 +499,10 @@ int TTparser::findFrames(TTsentence *sentence) { for (TTword *currP = word; currP && status <= 1; currP = currP->_nextP) status = processRequests(currP); - word->deleteSiblings(); - delete word; + if (word) { + word->deleteSiblings(); + delete word; + } } if (!status) { diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp index 785f33a470..6748d6535b 100644 --- a/engines/titanic/true_talk/tt_vocab.cpp +++ b/engines/titanic/true_talk/tt_vocab.cpp @@ -552,7 +552,6 @@ TTword *TTvocab::getPrefixedWord(TTstring &str) const { word->_text = str; } - delete tempStr; return word; } -- cgit v1.2.3