Make AnimatedSprite.animation complain when invalid animation name

(cherry picked from commit 2933ef42f7)
This commit is contained in:
Mateus Felipe C. C. Pinto 2018-12-19 20:38:19 -02:00 committed by Rémi Verschelde
parent 3078f723a8
commit 8946ac9616
1 changed files with 3 additions and 0 deletions

View File

@ -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;