summaryrefslogtreecommitdiff
path: root/src/resources/sprite
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-12-10 16:46:55 +0300
committerAndrei Karas <akaras@inbox.ru>2016-12-10 16:46:55 +0300
commit608dfae22e1b5145210314ca6c7268420dd639c8 (patch)
tree5f7317be7e895a1f8aede182ea69ef56d456c54f /src/resources/sprite
parent9eb389060d44672c311a36348036eab297859e7e (diff)
downloadplus-608dfae22e1b5145210314ca6c7268420dd639c8.tar.gz
plus-608dfae22e1b5145210314ca6c7268420dd639c8.tar.bz2
plus-608dfae22e1b5145210314ca6c7268420dd639c8.tar.xz
plus-608dfae22e1b5145210314ca6c7268420dd639c8.zip
Fix some issues found by automatic checks.
Diffstat (limited to 'src/resources/sprite')
-rw-r--r--src/resources/sprite/animatedsprite.cpp8
-rw-r--r--src/resources/sprite/spritedef.cpp2
2 files changed, 3 insertions, 7 deletions
diff --git a/src/resources/sprite/animatedsprite.cpp b/src/resources/sprite/animatedsprite.cpp
index 546c3a415..25c6d0e74 100644
--- a/src/resources/sprite/animatedsprite.cpp
+++ b/src/resources/sprite/animatedsprite.cpp
@@ -235,12 +235,8 @@ bool AnimatedSprite::updateCurrentAnimation(const unsigned int time) restrict2
mFrameIndex = 0;
mFrame = &mAnimation->mFrames[mFrameIndex];
- if (!mFrame)
- {
- fail = true;
- }
- else if ((mFrame->type == FrameType::LABEL
- && !mFrame->nextAction.empty()))
+ if ((mFrame->type == FrameType::LABEL &&
+ !mFrame->nextAction.empty()))
{
fail = false;
}
diff --git a/src/resources/sprite/spritedef.cpp b/src/resources/sprite/spritedef.cpp
index 2f6fcaf65..bcc37421a 100644
--- a/src/resources/sprite/spritedef.cpp
+++ b/src/resources/sprite/spritedef.cpp
@@ -418,7 +418,7 @@ void SpriteDef::loadAnimation(const XmlNodePtr animationNode,
FOR_EACH (StringVectCIter, it, vals)
{
const std::string str = *it;
- const size_t idx = str.find("-");
+ const size_t idx = str.find('-');
if (str == "p")
{
animation->addPause(delay, rand);