aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/journal.cpp2
-rw-r--r--engines/sherlock/people.h1
-rw-r--r--engines/sherlock/talk.cpp4
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) {