diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-07 12:11:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-07 12:11:58 +0300 |
commit | b638b4ca0dbe20e83e30a18f30357ddcc85c64d8 (patch) | |
tree | fd22edf4d7857161f50900186d60844061239758 | |
parent | 81c3e097402f19ec7e8ed1971c03a1b45ed0439e (diff) | |
download | mv-b638b4ca0dbe20e83e30a18f30357ddcc85c64d8.tar.gz mv-b638b4ca0dbe20e83e30a18f30357ddcc85c64d8.tar.bz2 mv-b638b4ca0dbe20e83e30a18f30357ddcc85c64d8.tar.xz mv-b638b4ca0dbe20e83e30a18f30357ddcc85c64d8.zip |
Fix wrong animation time in goto and label animation commands.
-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()) { |