diff options
author | Paul Gilbert | 2009-11-11 09:55:05 +0000 |
---|---|---|
committer | Paul Gilbert | 2009-11-11 09:55:05 +0000 |
commit | faaec05e65c4d4d1b2e079120df5cc14b003d3fd (patch) | |
tree | 63fdf66dba59a240e3f779ec0f77c23ad1ff3475 /engines/m4/globals.h | |
parent | 8ed71d903a81a8bfb744ad7bf652c52f062a18c9 (diff) | |
download | scummvm-rg350-faaec05e65c4d4d1b2e079120df5cc14b003d3fd.tar.gz scummvm-rg350-faaec05e65c4d4d1b2e079120df5cc14b003d3fd.tar.bz2 scummvm-rg350-faaec05e65c4d4d1b2e079120df5cc14b003d3fd.zip |
Removed all the '- 1' from calls to get vocabs, centralising it in the getVocab method. This is correct, as the first element in the game vocab list is '1', not '0'.
svn-id: r45827
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(); } |