aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-08-22 10:45:38 -0400
committerPaul Gilbert2015-08-22 10:45:38 -0400
commitb21991098c28e002aaa5a91d8c3fafede2ece18d (patch)
treeeab3d2fd977d684427fb34cc554e84b1b07538fb
parent5fd764c221bbbfa7f075862d310bb7098184c4dc (diff)
downloadscummvm-rg350-b21991098c28e002aaa5a91d8c3fafede2ece18d.tar.gz
scummvm-rg350-b21991098c28e002aaa5a91d8c3fafede2ece18d.tar.bz2
scummvm-rg350-b21991098c28e002aaa5a91d8c3fafede2ece18d.zip
SHERLOCK: RT: Workaround for occasional crash changing char sequence
-rw-r--r--engines/sherlock/tattoo/tattoo_people.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp
index a208949ae1..f6920358a5 100644
--- a/engines/sherlock/tattoo/tattoo_people.cpp
+++ b/engines/sherlock/tattoo/tattoo_people.cpp
@@ -962,6 +962,11 @@ void TattooPerson::checkWalkGraphics() {
_seqTo = _seqCounter = _seqCounter2 = _seqStack = _startSeq = 0;
_sequences = &_walkSequences[_sequenceNumber]._sequences[0];
_seqSize = _walkSequences[_sequenceNumber]._sequences.size();
+
+ // WORKAROUND: Occassionally when switching to a new walk sequence the existing frame number may be outside
+ // the allowed range for the new sequence. In such cases, reset the frame number
+ if (_frameNumber < 0 || _frameNumber >= (int)_seqSize || _walkSequences[_sequenceNumber][_frameNumber] == 0)
+ _frameNumber = 0;
}
setImageFrame();