aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-02-15 11:07:33 -0500
committerPaul Gilbert2015-02-15 11:07:33 -0500
commitdb325695f42e2dec3163b9a371085d8561e5a42a (patch)
treed59869a10cb7e06809a271640fa462707d2a21fe /engines
parent7739e12e42edae68264a9675ede1bd840ae3be6b (diff)
downloadscummvm-rg350-db325695f42e2dec3163b9a371085d8561e5a42a.tar.gz
scummvm-rg350-db325695f42e2dec3163b9a371085d8561e5a42a.tar.bz2
scummvm-rg350-db325695f42e2dec3163b9a371085d8561e5a42a.zip
MADS: Fix proper cycling of idle animations
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/player.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp
index e7993f378a..1622031c6c 100644
--- a/engines/mads/player.cpp
+++ b/engines/mads/player.cpp
@@ -235,11 +235,12 @@ void Player::selectSeries() {
void Player::updateFrame() {
// WORKAROUND: Prevent character info being referenced when not present
- if ((_spritesStart + _spritesIdx) < 0 || !_spriteSetsPresent[_spritesStart + _spritesIdx])
+ int idx = _spritesStart + _spritesIdx;
+ if (idx < 0 || (idx < PLAYER_SPRITES_FILE_COUNT && !_spriteSetsPresent[idx]))
return;
Scene &scene = _vm->_game->_scene;
- SpriteAsset &spriteSet = *scene._sprites[_spritesStart + _spritesIdx];
+ SpriteAsset &spriteSet = *scene._sprites[idx];
assert(spriteSet._charInfo);
if (!spriteSet._charInfo->_numEntries) {
@@ -529,11 +530,11 @@ void Player::idle() {
_frameNumber += direction;
_forceRefresh = true;
- if (spriteSet._charInfo->_stopFrames[frameIndex] < _frameNumber) {
+ if (_frameNumber > spriteSet._charInfo->_stopFrames[frameIndex]) {
_trigger = _upcomingTrigger;
updateFrame();
}
- if (spriteSet._charInfo->_startFrames[frameIndex] < _frameNumber) {
+ if (_frameNumber < spriteSet._charInfo->_startFrames[frameIndex]) {
_trigger = _upcomingTrigger;
updateFrame();
}