From b21991098c28e002aaa5a91d8c3fafede2ece18d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 22 Aug 2015 10:45:38 -0400 Subject: SHERLOCK: RT: Workaround for occasional crash changing char sequence --- engines/sherlock/tattoo/tattoo_people.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/sherlock/tattoo') 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(); -- cgit v1.2.3