aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-28 16:03:39 -0400
committerPaul Gilbert2016-07-15 19:16:26 -0400
commit15843eb4c23c3d8ac88edd9b482fae09d4414582 (patch)
tree6e5f96f298ea69a9fed4de0b98b3b0f0f74237ad /engines/titanic/true_talk
parentfb6e94e8bbe6e5fa2656f3a134b015cf4e986364 (diff)
downloadscummvm-rg350-15843eb4c23c3d8ac88edd9b482fae09d4414582.tar.gz
scummvm-rg350-15843eb4c23c3d8ac88edd9b482fae09d4414582.tar.bz2
scummvm-rg350-15843eb4c23c3d8ac88edd9b482fae09d4414582.zip
TITANIC: Remainder of TTparser considerRequests
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r--engines/titanic/true_talk/tt_parser.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 91bc82db70..3014ebaa07 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -725,17 +725,16 @@ int TTparser::loadRequests(TTword *word) {
}
int TTparser::considerRequests(TTword *word) {
- if (_nodesP)
+ if (!_nodesP || !word)
return 0;
-
- TTparserNode *nodeP = _nodesP;
+
TTconcept *concept = nullptr;
int status = 0;
bool flag = false;
bool modifierFlag = false;
int seekVal = 0;
- while (word) {
+ for (TTparserNode *nodeP = _nodesP; nodeP; ) {
switch (nodeP->_tag) {
case CHECK_COMMAND_FORM:
if (_sentenceConcept->_concept1P && _sentence->_field2C == 1 &&
@@ -1274,9 +1273,13 @@ int TTparser::considerRequests(TTword *word) {
flag = true;
break;
}
+
+ TTparserNode *nextP = static_cast<TTparserNode *>(nodeP->_nextP);
+ if (flag)
+ delete nodeP;
+ nodeP = nextP;
}
- // TODO
delete concept;
return status;
}