diff options
Diffstat (limited to 'engines/sherlock/people.h')
-rw-r--r-- | engines/sherlock/people.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/engines/sherlock/people.h b/engines/sherlock/people.h index bec078d11e..ba870d041d 100644 --- a/engines/sherlock/people.h +++ b/engines/sherlock/people.h @@ -34,7 +34,8 @@ enum PeopleId { PLAYER = 0, AL = 0, PEG = 1, - MAX_PEOPLE = 66 + NUM_OF_PEOPLE = 2, // Holmes and Watson + MAX_PEOPLE = 66 // Total of all NPCs }; // Animation sequence identifiers for characters @@ -62,7 +63,7 @@ public: class People { private: SherlockEngine *_vm; - Person _data[MAX_PEOPLE]; + Person _data[NUM_OF_PEOPLE]; bool _walkLoaded; int _oldWalkSequence; int _srcZone, _destZone; @@ -84,8 +85,14 @@ public: People(SherlockEngine *vm); ~People(); - Person &operator[](PeopleId id) { return _data[id]; } - Person &operator[](int idx) { return _data[idx]; } + Person &operator[](PeopleId id) { + assert(id < NUM_OF_PEOPLE); + return _data[id]; + } + Person &operator[](int idx) { + assert(idx < NUM_OF_PEOPLE); + return _data[idx]; + } bool isHolmesActive() const { return _walkLoaded && _holmesOn; } |