Merge pull request #75258 from AThousandShips/autoplay

Fix `AnimatedSprite2D` autoplay warning
This commit is contained in:
Yuri Sizov 2023-03-25 14:28:27 +01:00 committed by GitHub
commit 32c65c92a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -301,13 +301,13 @@ void AnimatedSprite2D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
frames->get_animation_list(&al);
if (al.size() == 0) {
set_animation(StringName());
set_autoplay(String());
autoplay = String();
} else {
if (!frames->has_animation(animation)) {
set_animation(al[0]);
}
if (!frames->has_animation(autoplay)) {
set_autoplay(String());
autoplay = String();
}
}
}