From 8c01b9ff3f41b2ba6f88a9efa7d49d559a446de9 Mon Sep 17 00:00:00 2001 From: "Silc Lizard (Tokage) Renew" <61938263+TokageItLab@users.noreply.github.com> Date: Tue, 24 Feb 2026 02:11:11 +0900 Subject: [PATCH] Check playback_queue existance after animation_finished signal --- scene/animation/animation_player.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index fa348fae73..faf63ee3b5 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -336,9 +336,16 @@ void AnimationPlayer::_blend_post_process() { if (end_reached) { // If the method track changes current animation, the animation is not finished. if (tmp_from == animation_set[playback.current.animation_name].animation->get_instance_id()) { - if (playback_queue.size()) { + if (!playback_queue.is_empty()) { if (!finished_anim.is_empty()) { emit_signal(SceneStringName(animation_finished), finished_anim); + // Abort if playback_queue is cleared by animation_finished signal. + if (playback_queue.is_empty()) { + end_reached = false; + end_notify = false; + tmp_from = ObjectID(); + return; + } } String old = playback.assigned; play(playback_queue.front()->get());