diff options
author | Willem Jan Palenstijn | 2011-05-14 00:48:57 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-05-14 00:48:57 +0200 |
commit | e7a006f21865dcb15b05b3fc27903dd03a1dd8b2 (patch) | |
tree | 86cf2196aaa7f8251419ac558e2838659fd06cf6 | |
parent | 47e7850b91a12a69ff4a65e9f0cf899d6f280049 (diff) | |
download | scummvm-rg350-e7a006f21865dcb15b05b3fc27903dd03a1dd8b2.tar.gz scummvm-rg350-e7a006f21865dcb15b05b3fc27903dd03a1dd8b2.tar.bz2 scummvm-rg350-e7a006f21865dcb15b05b3fc27903dd03a1dd8b2.zip |
SCI: Hardcode parser output in one case in QfG2 to fix #3288328
This is a stopgap measure to make this work in the release.
-rw-r--r-- | engines/sci/parser/grammar.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp index b330a432e3..8d99100fa7 100644 --- a/engines/sci/parser/grammar.cpp +++ b/engines/sci/parser/grammar.cpp @@ -603,6 +603,28 @@ 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(); |