summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNinni Pipping <over999ships@gmail.com>2023-03-23 14:31:46 +0100
committerYuri Sizov <yuris@humnom.net>2023-03-27 17:49:44 +0200
commit2a52307936f11aede9c8968f8c02c8e8f9ee29e1 (patch)
tree2b0b5b0136fdd8967c9dd190f5ec26d333a6f84b
parent9a4a0d042c41ecf6a3ba0ffe9107db9f616b2c60 (diff)
Fix `AnimatedSprite2D` autoplay warning
Changing of autoplay when changing `SpriteFrames` is not done by the user and warning is unhelpful (cherry picked from commit 4d4342e018367499c6b6709e6dc3ca60c4f3dd7a)
-rw-r--r--scene/2d/animated_sprite_2d.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/2d/animated_sprite_2d.cpp b/scene/2d/animated_sprite_2d.cpp
index 8f7006caca..7de6219b10 100644
--- a/scene/2d/animated_sprite_2d.cpp
+++ b/scene/2d/animated_sprite_2d.cpp
@@ -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();
}
}
}