aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-05-14 18:04:10 +0200
committerWillem Jan Palenstijn2011-05-14 18:04:10 +0200
commit8fb0d27f957893d3b399ff954b4d4be93b060e3e (patch)
tree72c0142713afac7b7b8cb732a731d4b1a72f29ab /engines
parentea1ef4386a4c76b9910d72aaacd035240005ee46 (diff)
downloadscummvm-rg350-8fb0d27f957893d3b399ff954b4d4be93b060e3e.tar.gz
scummvm-rg350-8fb0d27f957893d3b399ff954b4d4be93b060e3e.tar.bz2
scummvm-rg350-8fb0d27f957893d3b399ff954b4d4be93b060e3e.zip
SCI: Replace QfG2 parser hack with simpler variant
This replaces the workaround for bug #3288328 from e7a006f2 with a bug-specific case of the more general patch committed to master in eb46c72b.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/parser/grammar.cpp22
-rw-r--r--engines/sci/parser/vocabulary.cpp6
2 files changed, 6 insertions, 22 deletions
diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp
index 8d99100fa7..b330a432e3 100644
--- a/engines/sci/parser/grammar.cpp
+++ b/engines/sci/parser/grammar.cpp
@@ -603,28 +603,6 @@ int Vocabulary::parseGNF(const ResultWordListList &words, bool verbose) {
results = work;
- if (g_sci->getGameId() == GID_QFG2 && words.size() == 3 && results->next) {
- // WORKAROUND:
- // This is a serious hack to temporarily fix bug #3288328.
- // The groups below spell out "buy healing pills" in QfG2.
- // It results in four valid expansions, but only the second one
- // matches the said spec in the apothecary script, so we force
- // that one.
-
- bool ok = true;
- words_iter = words.begin();
- if (words_iter->size() != 1 || words_iter->begin()->_group != 0x3f4)
- ok = false;
- words_iter++;
- if (words_iter->size() != 2 || words_iter->begin()->_group != 0xa88)
- ok = false;
- words_iter++;
- if (words_iter->size() != 1 || words_iter->begin()->_group != 0xad3)
- ok = false;
- if (ok)
- results = results->next;
- }
-
if (verbose) {
con->DebugPrintf("All results (excluding the surrounding '(141 %03x' and ')'):\n", _parserBranches[0].id);
results->print();
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp
index 25043401cc..11d214b28d 100644
--- a/engines/sci/parser/vocabulary.cpp
+++ b/engines/sci/parser/vocabulary.cpp
@@ -398,6 +398,12 @@ void Vocabulary::lookupWord(ResultWordList& retval, const char *word, int word_l
if (getSciVersion() < SCI_VERSION_01)
return;
+ // WORKAROUND:
+ // This is a hack to temporarily fix bug #3288328.
+ // On the master branch this return is unconditional.
+ if (g_sci->getGameId() == GID_QFG2 && strcmp(word, "healing") == 0)
+ return;
+
}
// Now try all suffixes