diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/animatedsprite.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
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()) { |