diff options
author | Paul Gilbert | 2015-05-21 21:23:09 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-05-21 21:23:09 -0400 |
commit | bfbeed4f5eb8986f93a3248251b3740e3b9ed6ad (patch) | |
tree | 03248b9c8ce9a2ba276290852537762c45e06593 /engines/sherlock | |
parent | 5c30a2c5772049702e1c65d10ae32dec8e6f1cdc (diff) | |
download | scummvm-rg350-bfbeed4f5eb8986f93a3248251b3740e3b9ed6ad.tar.gz scummvm-rg350-bfbeed4f5eb8986f93a3248251b3740e3b9ed6ad.tar.bz2 scummvm-rg350-bfbeed4f5eb8986f93a3248251b3740e3b9ed6ad.zip |
SHERLOCK: Replaced second MAX_PEOPLE definition with _characters.size()
Diffstat (limited to 'engines/sherlock')
-rw-r--r-- | engines/sherlock/journal.cpp | 2 | ||||
-rw-r--r-- | engines/sherlock/people.h | 1 | ||||
-rw-r--r-- | engines/sherlock/talk.cpp | 4 |
3 files changed, 3 insertions, 4 deletions
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp index 50802f1625..564db59042 100644 --- a/engines/sherlock/journal.cpp +++ b/engines/sherlock/journal.cpp @@ -152,7 +152,7 @@ void Journal::loadJournalFile(bool alreadyLoaded) { // Find the person being referred to talk._talkTo = -1; - for (int idx = 0; idx < MAX_PEOPLE; ++idx) { + for (int idx = 0; idx < (int)people._characters.size(); ++idx) { Common::String portrait = people[idx]._portrait; Common::String numStr(portrait.c_str(), portrait.c_str() + 4); diff --git a/engines/sherlock/people.h b/engines/sherlock/people.h index 74c057e542..c32681fdd1 100644 --- a/engines/sherlock/people.h +++ b/engines/sherlock/people.h @@ -36,7 +36,6 @@ enum PeopleId { AL = 0, PEG = 1, NUM_OF_PEOPLE = 2, // Holmes and Watson - MAX_PEOPLE = 66 // Total of all NPCs }; // Animation sequence identifiers for characters diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index 6bac16c9bf..319d1a383f 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -537,7 +537,7 @@ void Talk::loadTalkFile(const Common::String &filename) { // Check for an existing person being talked to _talkTo = -1; - for (int idx = 0; idx < MAX_PEOPLE; ++idx) { + for (int idx = 0; idx < (int)people._characters.size(); ++idx) { if (!scumm_strnicmp(filename.c_str(), people._characters[idx]._portrait, 4)) { _talkTo = idx; break; @@ -1415,7 +1415,7 @@ void Talk::doScript(const Common::String &script) { } // If it's the first line, display the speaker - if (!line && _speaker >= 0 && _speaker < MAX_PEOPLE) { + if (!line && _speaker >= 0 && _speaker < (int)people._characters.size()) { // If the window is open, display the name directly on-screen. // Otherwise, simply draw it on the back buffer if (ui._windowOpen) { |