summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2019-04-23 06:36:32 +0300
committerGitHub <noreply@github.com>2019-04-23 06:36:32 +0300
commit5c28296efe2cf950c91b566eadf280fc350b517c (patch)
tree6b4c894b199d6ac623d99594af90e481e71140d5
parentfc2e2dfa435cfc87042939a4dbe4ccfd10d750ac (diff)
parent2933ef42f791581c3109889ee002a8940685e608 (diff)
Merge pull request #24489 from mateusfccp/18264_wrong_animation_error
Make AnimatedSprite.animation complain when invalid animation name
-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 932db8f001..25ad6bd5c9 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;