summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorMateus Felipe C. C. Pinto <mateusfccp@gmail.com>2018-12-19 20:38:19 -0200
committerMateus Felipe C. C. Pinto <mateusfccp@gmail.com>2018-12-20 08:44:28 -0200
commit2933ef42f791581c3109889ee002a8940685e608 (patch)
treefcf2c8ca5f81e5f4b0ba69a20614594c99274ccf /scene
parenta06f8ca6b9838c587841afc17d990646ac9997e4 (diff)
Make AnimatedSprite.animation complain when invalid animation name
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/animated_sprite.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp
index b11c2c2886..f6eb494641 100644
--- a/scene/2d/animated_sprite.cpp
+++ b/scene/2d/animated_sprite.cpp
@@ -632,6 +632,9 @@ void AnimatedSprite::_reset_timeout() {
void AnimatedSprite::set_animation(const StringName &p_animation) {
+ ERR_EXPLAIN(vformat("There is no animation with name '%s'.", p_animation));
+ ERR_FAIL_COND(frames->get_animation_names().find(p_animation) == -1);
+
if (animation == p_animation)
return;