summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-07 12:11:58 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-07 12:11:58 +0300
commitb638b4ca0dbe20e83e30a18f30357ddcc85c64d8 (patch)
treefd22edf4d7857161f50900186d60844061239758
parent81c3e097402f19ec7e8ed1971c03a1b45ed0439e (diff)
downloadplus-b638b4ca0dbe20e83e30a18f30357ddcc85c64d8.tar.gz
plus-b638b4ca0dbe20e83e30a18f30357ddcc85c64d8.tar.bz2
plus-b638b4ca0dbe20e83e30a18f30357ddcc85c64d8.tar.xz
plus-b638b4ca0dbe20e83e30a18f30357ddcc85c64d8.zip
Fix wrong animation time in goto and label animation commands.
-rw-r--r--src/animatedsprite.cpp16
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())
{