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:
parent
e633ce1014
commit
2bbcfa2284
2 changed files with 6 additions and 2 deletions
|
@ -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 << "] ";
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue