mirror of
https://github.com/godotengine/godot.git
synced 2025-01-23 19:12:24 -05:00
Make AnimatedSprite.animation complain when invalid animation name
This commit is contained in:
parent
a06f8ca6b9
commit
2933ef42f7
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue