From 8946ac96162e776ff551de53d8171d1fbdba4ed4 Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 19 Dec 2018 20:38:19 -0200 Subject: [PATCH] Make AnimatedSprite.animation complain when invalid animation name (cherry picked from commit 2933ef42f791581c3109889ee002a8940685e608) --- scene/2d/animated_sprite.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 932db8f0011..25ad6bd5c90 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -645,6 +645,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;