aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-11-03 23:04:58 -0400
committerPaul Gilbert2016-11-03 23:04:58 -0400
commite58dad8bb6f50c160de4465551abbe877b673360 (patch)
treedc60871532fedef362f0e05b12c7c11cd33d6864 /engines/titanic
parentc32be8ebeb45558cf2eb20c199bb06218f55d2fb (diff)
downloadscummvm-rg350-e58dad8bb6f50c160de4465551abbe877b673360.tar.gz
scummvm-rg350-e58dad8bb6f50c160de4465551abbe877b673360.tar.bz2
scummvm-rg350-e58dad8bb6f50c160de4465551abbe877b673360.zip
TITANIC: Parser fixes for using unrecognised words
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/support/font.cpp2
-rw-r--r--engines/titanic/true_talk/tt_parser.cpp6
-rw-r--r--engines/titanic/true_talk/tt_vocab.cpp1
3 files changed, 5 insertions, 4 deletions
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;
}