diff options
Diffstat (limited to 'engines/m4/globals.h')
-rw-r--r-- | engines/m4/globals.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/m4/globals.h b/engines/m4/globals.h index 37348b1367..c77f0b2089 100644 --- a/engines/m4/globals.h +++ b/engines/m4/globals.h @@ -194,7 +194,11 @@ public: void loadMadsVocab(); uint32 getVocabSize() { return _madsVocab.size(); } - const char *getVocab(uint32 index) { return _madsVocab[index]; } + const char *getVocab(uint32 index) { + // Vocab list is 1-based, so always subtract one from index provided + assert((index > 0) && (index <= _madsVocab.size())); + return _madsVocab[index - 1]; + } void loadMadsQuotes(); uint32 getQuotesSize() { return _madsQuotes.size(); } |