mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-16 17:45:52 +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)
|
void AnimationEditor::update(float dt)
|
||||||
{
|
{
|
||||||
StateObject::update(dt);
|
StateObject::update(dt);
|
||||||
|
if(!editSprite->getCurrentAnimation())
|
||||||
|
return;
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << editingFile;
|
os << editingFile;
|
||||||
os << " anim[" << editSprite->getCurrentAnimation()->name << "] ";
|
os << " anim[" << editSprite->getCurrentAnimation()->name << "] ";
|
||||||
|
|
|
@ -1211,7 +1211,8 @@ void SkeletalSprite::loadSkin(const std::string &fn)
|
||||||
|
|
||||||
void SkeletalSprite::stopAnimation(int layer)
|
void SkeletalSprite::stopAnimation(int layer)
|
||||||
{
|
{
|
||||||
animLayers[layer].stopAnimation();
|
if(size_t(layer) < animLayers.size())
|
||||||
|
animLayers[layer].stopAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkeletalSprite::stopAllAnimations()
|
void SkeletalSprite::stopAllAnimations()
|
||||||
|
@ -1224,7 +1225,8 @@ void SkeletalSprite::stopAllAnimations()
|
||||||
|
|
||||||
void SkeletalSprite::playCurrentAnimation(int loop, int layer)
|
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)
|
void SkeletalSprite::loadSkeletal(const std::string &fn)
|
||||||
|
|
Loading…
Add table
Reference in a new issue