1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-25 09:44:02 +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,7 +1211,8 @@ void SkeletalSprite::loadSkin(const std::string &fn)
void SkeletalSprite::stopAnimation(int layer)
{
animLayers[layer].stopAnimation();
if(size_t(layer) < animLayers.size())
animLayers[layer].stopAnimation();
}
void SkeletalSprite::stopAllAnimations()
@ -1224,7 +1225,8 @@ void SkeletalSprite::stopAllAnimations()
void SkeletalSprite::playCurrentAnimation(int loop, int layer)
{
animLayers[layer].playCurrentAnimation(loop);
if(size_t(layer) < animLayers.size())
animLayers[layer].playCurrentAnimation(loop);
}
void SkeletalSprite::loadSkeletal(const std::string &fn)