From b638b4ca0dbe20e83e30a18f30357ddcc85c64d8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 7 Jun 2013 12:11:58 +0300 Subject: Fix wrong animation time in goto and label animation commands. --- src/animatedsprite.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/animatedsprite.cpp') diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index d802f9b9a..211b73f87 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -205,11 +205,15 @@ bool AnimatedSprite::updateCurrentAnimation(const unsigned int time) mFrameIndex = 0; mFrame = &mAnimation->mFrames[mFrameIndex]; - if (!mFrame || (mFrame->type == Frame::LABEL - && !mFrame->nextAction.empty())) + if (!mFrame) { fail = true; } + if ((mFrame->type == Frame::LABEL + && !mFrame->nextAction.empty())) + { + fail = false; + } else if (mFrame->type == Frame::GOTO && !mFrame->nextAction.empty()) { if (mFrame->rand == 100 || rand() % 100 <= mFrame->rand) @@ -220,18 +224,22 @@ bool AnimatedSprite::updateCurrentAnimation(const unsigned int time) if (frame->type == Frame::LABEL && mFrame->nextAction == frame->nextAction) { - mFrameTime = 0; +// mFrameTime = 0; mFrameIndex = i; if (mFrameIndex >= mAnimation->getLength()) mFrameIndex = 0; mFrame = &mAnimation->mFrames[mFrameIndex]; - fail = true; + fail = false; break; } } } + else + { + fail = false; + } } else if (mFrame->type == Frame::JUMP && !mFrame->nextAction.empty()) { -- cgit v1.2.3-60-g2f50