aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sherlock/objects.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index bdb554330a..a360f9abf9 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -260,7 +260,8 @@ void Sprite::adjustSprite() {
if (!map._active || (map._frameChangeFlag = !map._frameChangeFlag))
++_frameNumber;
- if (_walkSequences[_sequenceNumber][_frameNumber] == 0) {
+ if (_frameNumber >= _walkSequences[_sequenceNumber]._sequences.size() ||
+ _walkSequences[_sequenceNumber][_frameNumber] == 0) {
switch (_sequenceNumber) {
case Scalpel::STOP_UP:
case Scalpel::STOP_DOWN: