diff options
author | Paul Gilbert | 2015-08-22 10:45:38 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-08-22 10:45:38 -0400 |
commit | b21991098c28e002aaa5a91d8c3fafede2ece18d (patch) | |
tree | eab3d2fd977d684427fb34cc554e84b1b07538fb | |
parent | 5fd764c221bbbfa7f075862d310bb7098184c4dc (diff) | |
download | scummvm-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.cpp | 5 |
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(); |