From ef82a7df8aafb569f6db5e77ff2dd67fde860148 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 26 Aug 2006 18:50:34 +0000 Subject: Applied patch by Bahamut81 which implements resetting of Animation, Action and AnimatedSprite. This fixes the animation synchronization issues. --- src/player.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/player.cpp') diff --git a/src/player.cpp b/src/player.cpp index 3fe608c7..1658840a 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -98,6 +98,7 @@ Player::setSex(Uint8 sex) mSprites[BASE_SPRITE] = new AnimatedSprite( "graphics/sprites/player_female_base.xml", 0); } + resetAnimations(); } Being::setSex(sex); } @@ -114,6 +115,7 @@ Player::setHairColor(Uint16 color) newHairSprite->setDirection(getSpriteDirection()); mSprites[HAIR_SPRITE] = newHairSprite; + resetAnimations(); setAction(mAction); } @@ -133,6 +135,7 @@ Player::setHairStyle(Uint16 style) newHairSprite->setDirection(getSpriteDirection()); mSprites[HAIR_SPRITE] = newHairSprite; + resetAnimations(); setAction(mAction); } @@ -170,6 +173,7 @@ Player::setVisibleEquipment(Uint8 slot, Uint8 id) equipmentSprite->setDirection(getSpriteDirection()); mSprites[position] = equipmentSprite; + resetAnimations(); setAction(mAction); } @@ -177,4 +181,14 @@ Player::setVisibleEquipment(Uint8 slot, Uint8 id) Being::setVisibleEquipment(slot, id); } - +void +Player::resetAnimations() +{ + for (int i = 0; i < VECTOREND_SPRITE; i++) + { + if (mSprites[i] != NULL) + { + mSprites[i]->reset(); + } + } +} -- cgit v1.2.3-70-g09d2