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:
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,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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue