Fix AnimatedSprite3D autoplay warning

(cherry picked from commit d3d84d90de)
This commit is contained in:
kleonc 2023-05-13 13:10:38 +02:00 committed by Yuri Sizov
parent 2bcad4c55b
commit 3af3e88d81

View File

@ -1095,13 +1095,13 @@ void AnimatedSprite3D::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();
}
}
}