Call stop after setting new sprite frames

This commit is contained in:
Paweł
2026-03-19 21:59:33 +01:00
parent 456bdea954
commit f7523827cd
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -316,7 +316,6 @@ void AnimatedSprite2D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
if (frames.is_valid()) {
frames->disconnect(CoreStringName(changed), callable_mp(this, &AnimatedSprite2D::_res_changed));
}
stop();
frames = p_frames;
if (frames.is_valid()) {
frames->connect(CoreStringName(changed), callable_mp(this, &AnimatedSprite2D::_res_changed));
@@ -335,6 +334,7 @@ void AnimatedSprite2D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
}
}
}
stop();
notify_property_list_changed();
queue_redraw();
+1 -1
View File
@@ -1217,7 +1217,6 @@ void AnimatedSprite3D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
if (frames.is_valid()) {
frames->disconnect(CoreStringName(changed), callable_mp(this, &AnimatedSprite3D::_res_changed));
}
stop();
frames = p_frames;
if (frames.is_valid()) {
frames->connect(CoreStringName(changed), callable_mp(this, &AnimatedSprite3D::_res_changed));
@@ -1236,6 +1235,7 @@ void AnimatedSprite3D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
}
}
}
stop();
notify_property_list_changed();
_queue_redraw();