aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2019-03-03 11:24:39 -0800
committerPaul Gilbert2019-03-03 11:24:39 -0800
commita3873e7e4bb9022382b97ae9b916aa957f240bdb (patch)
treeb2b4850d1001b0051fb3a1cdbf13abb86ddbb7f1 /engines/titanic
parent81e28c7bfabe80fb2c7c1e01442040027eec9aeb (diff)
downloadscummvm-rg350-a3873e7e4bb9022382b97ae9b916aa957f240bdb.tar.gz
scummvm-rg350-a3873e7e4bb9022382b97ae9b916aa957f240bdb.tar.bz2
scummvm-rg350-a3873e7e4bb9022382b97ae9b916aa957f240bdb.zip
TITANIC: Fix crash asking Parrot who sabotaged the ship
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/true_talk/tt_concept.cpp4
-rw-r--r--engines/titanic/true_talk/tt_parser.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index a1bb1bcc32..990c8d204f 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -301,10 +301,14 @@ TTconcept *TTconcept::findBy20(int val) {
}
bool TTconcept::isWordId(int id) const {
+ if (this == nullptr)
+ return false;
return _wordP && _wordP->_id == id;
}
int TTconcept::getWordId() const {
+ if (this == nullptr)
+ return 0;
return _wordP ? _wordP->_id : 0;
}
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index e34b1b8ab0..99f2c78f3a 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -801,7 +801,7 @@ int TTparser::considerRequests(TTword *word) {
if (!_sentenceConcept->_concept0P) {
flag = filterConcepts(5, 0);
} else if (_sentenceConcept->_concept0P->compareTo("?") &&
- _sentenceConcept->_concept1P->isWordId(113) &&
+ (_sentenceConcept->_concept1P && _sentenceConcept->_concept1P->isWordId(113)) &&
word->_wordClass == WC_THING) {
TTconcept *oldConcept = _sentenceConcept->_concept0P;
_sentenceConcept->_concept0P = nullptr;