aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-10-01 19:58:51 +0200
committerWillem Jan Palenstijn2013-10-01 19:58:51 +0200
commitb1a7492da88460ff13795fe16ed630ecb2489944 (patch)
tree4cea55af59029fbc55cb5b94a6aa7c094cce31fb /engines
parent574a2a64fe23f050032e12d3d85213a656a836be (diff)
downloadscummvm-rg350-b1a7492da88460ff13795fe16ed630ecb2489944.tar.gz
scummvm-rg350-b1a7492da88460ff13795fe16ed630ecb2489944.tar.bz2
scummvm-rg350-b1a7492da88460ff13795fe16ed630ecb2489944.zip
AGI: Skip words starting with digits that are filed under 'a' in the dictionary.
The fan game SQ0 does this (for '7up', among others), and this caused us to skip all words starting with an 'a'. Bug #3615061.
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/words.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp
index 9c5b3d349a..f423995de8 100644
--- a/engines/agi/words.cpp
+++ b/engines/agi/words.cpp
@@ -93,14 +93,25 @@ int AgiEngine::loadWords(const char *fname) {
} while (!(c & 0x80) && k < (int)sizeof(str) - 1);
str[k] = 0;
- // And store it in our internal dictionary
- AgiWord *w = new AgiWord;
- w->word = myStrndup(str, k);
- w->id = fp.readUint16BE();
- _game.words[i].push_back(w);
+ // WORKAROUND:
+ // The SQ0 fan game stores words starting with numbers (like '7up')
+ // in its dictionary under the 'a' entry. We skip these.
+ // See bug #3615061
+ if (str[0] == 'a' + i) {
+ // And store it in our internal dictionary
+ AgiWord *w = new AgiWord;
+ w->word = myStrndup(str, k);
+ w->id = fp.readUint16BE();
+ _game.words[i].push_back(w);
+ }
+
+ k = fp.readByte();
// Are there more words with an already known prefix?
- if (!(k = fp.readByte()))
+ // WORKAROUND: We only break after already seeing words with the
+ // right prefix, for the SQ0 words starting with digits filed under
+ // 'a'. See above comment and bug #3615061.
+ if (k == 0 && str[0] >= 'a' + i)
break;
}
}