aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/parser
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/parser')
-rw-r--r--engines/sci/parser/vocabulary.cpp6
-rw-r--r--engines/sci/parser/vocabulary.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp
index 82051a3ecd..b4bd4dcb16 100644
--- a/engines/sci/parser/vocabulary.cpp
+++ b/engines/sci/parser/vocabulary.cpp
@@ -82,6 +82,12 @@ Vocabulary::~Vocabulary() {
freeSuffixes();
}
+void Vocabulary::reset() {
+ parserIsValid = false; // Invalidate parser
+ parser_event = NULL_REG; // Invalidate parser event
+ parser_base = make_reg(g_sci->getEngineState()->_segMan->getSysStringsSegment(), SYS_STRING_PARSER_BASE);
+}
+
bool Vocabulary::loadParserWords() {
char currentWord[VOCAB_MAX_WORDLENGTH] = "";
int currentWordPos = 0;
diff --git a/engines/sci/parser/vocabulary.h b/engines/sci/parser/vocabulary.h
index 80ed68547d..5c8c8fd57d 100644
--- a/engines/sci/parser/vocabulary.h
+++ b/engines/sci/parser/vocabulary.h
@@ -174,6 +174,9 @@ public:
Vocabulary(ResourceManager *resMan, bool foreign);
~Vocabulary();
+ // reset parser status
+ void reset();
+
/**
* Gets any word from the specified group. For debugging only.
* @param group Group number