1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 03:33:48 +00:00

Fix some ANimationEditor crashes when loading not-existing or empty anim XML

This commit is contained in:
fgenesis 2017-04-19 02:05:57 +02:00
parent e633ce1014
commit 2bbcfa2284
2 changed files with 6 additions and 2 deletions

View file

@ -688,6 +688,8 @@ void AnimationEditor::selectNextBone()
void AnimationEditor::update(float dt)
{
StateObject::update(dt);
if(!editSprite->getCurrentAnimation())
return;
std::ostringstream os;
os << editingFile;
os << " anim[" << editSprite->getCurrentAnimation()->name << "] ";

View file

@ -1211,6 +1211,7 @@ void SkeletalSprite::loadSkin(const std::string &fn)
void SkeletalSprite::stopAnimation(int layer)
{
if(size_t(layer) < animLayers.size())
animLayers[layer].stopAnimation();
}
@ -1224,6 +1225,7 @@ void SkeletalSprite::stopAllAnimations()
void SkeletalSprite::playCurrentAnimation(int loop, int layer)
{
if(size_t(layer) < animLayers.size())
animLayers[layer].playCurrentAnimation(loop);
}