From 409271778e35b5089330abd589e3304f6f25064a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 27 May 2016 07:41:05 -0400 Subject: TITANIC: Added TTparser removeNode --- engines/titanic/true_talk/tt_parser.cpp | 8 ++++++++ engines/titanic/true_talk/tt_parser.h | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index 5a94196552..f2abe5eec0 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -975,6 +975,14 @@ void TTparser::removeConcept(TTconcept *concept) { delete concept; } +void TTparser::removeNode(TTparserNode *node) { + if (!node->_priorP) + // Node is the head of the chain, so reset parser's nodes pointer + _nodesP = static_cast(node->_nextP); + + delete node; +} + int TTparser::checkForAction() { int status = SS_VALID; bool flag = false; diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h index 5d431114ec..95a3be42d4 100644 --- a/engines/titanic/true_talk/tt_parser.h +++ b/engines/titanic/true_talk/tt_parser.h @@ -164,6 +164,12 @@ private: */ void removeConcept(TTconcept *concept); + /** + * Detaches a node from the main node list + */ + void removeNode(TTparserNode *node); + + int checkForAction(); int fn2(TTword *word); bool checkConcept2(TTconcept *concept, int conceptMode); -- cgit v1.2.3