diff --git a/Aquaria/AnimationEditor.cpp b/Aquaria/AnimationEditor.cpp index d0173e3..882b735 100644 --- a/Aquaria/AnimationEditor.cpp +++ b/Aquaria/AnimationEditor.cpp @@ -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 << "] "; diff --git a/BBGE/SkeletalSprite.cpp b/BBGE/SkeletalSprite.cpp index 050aa42..19a91cb 100644 --- a/BBGE/SkeletalSprite.cpp +++ b/BBGE/SkeletalSprite.cpp @@ -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)