diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-09-01 21:51:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-09-01 21:54:54 +0300 |
commit | 7778c082e9b15774a1e79ab77cb60edb5c3a2949 (patch) | |
tree | 4eeeabda71cb5f2f330d52ee93c8922eef054d9e /src/resources | |
parent | f5e3f241af190e487c0499dae0efc12e9ae2d202 (diff) | |
download | plus-7778c082e9b15774a1e79ab77cb60edb5c3a2949.tar.gz plus-7778c082e9b15774a1e79ab77cb60edb5c3a2949.tar.bz2 plus-7778c082e9b15774a1e79ab77cb60edb5c3a2949.tar.xz plus-7778c082e9b15774a1e79ab77cb60edb5c3a2949.zip |
Add some checks after automatic check code by tools.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/sprite/spritedef.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/resources/sprite/spritedef.cpp b/src/resources/sprite/spritedef.cpp index 5fdb68584..aa79ef9f8 100644 --- a/src/resources/sprite/spritedef.cpp +++ b/src/resources/sprite/spritedef.cpp @@ -142,8 +142,12 @@ void SpriteDef::fixDeadAction() const ActionMap::iterator i = d->find(SpriteAction::DEAD); const ActionMap::iterator i2 = d->find(SpriteAction::STAND); // search dead action and check what it not same with stand action - if (i != d->end() && (i->second != nullptr) && i->second != i2->second) + if (i != d->end() && + i->second != nullptr && + (i2 == d->end() || i->second != i2->second)) + { (i->second)->setLastFrameDelay(0); + } } } @@ -300,9 +304,13 @@ void SpriteDef::loadAction(XmlNodeConstPtr node, // dirty hack to fix bad resources in tmw server if (actionName == "attack_stab") + { + reportAlways("Found legacy attribute attack_stab in animation"); addAction(hp, "attack", action); + } - // When first action set it as default direction + // When first action, set it as default direction. + // i here always correct, because hp was added above. const Actions::const_iterator i = mActions.find(hp); if ((*i).second->size() == 1) addAction(hp, SpriteAction::DEFAULT, action); |