From 15b5bc88e247d4d7d461b7495af77019387959a0 Mon Sep 17 00:00:00 2001 From: "Guilherme Felipe de C. G. da Silva" Date: Tue, 9 Aug 2022 16:55:07 -0300 Subject: Re-add AnimationNodeStateMachine::end_node for root state machine Fix #63660 --- scene/animation/animation_node_state_machine.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'scene/animation') diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 793967d9ad..b27082002a 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -594,11 +594,13 @@ double AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *p_s if (p_state_machine->end_node != current) { rem = 1; } else { - Ref prev_playback = p_state_machine->prev_state_machine->get_parameter("playback"); + if (p_state_machine->prev_state_machine != nullptr) { + Ref prev_playback = p_state_machine->prev_state_machine->get_parameter(p_state_machine->playback); - if (prev_playback.is_valid()) { - prev_playback->current_transition = current_transition; - prev_playback->force_auto_advance = true; + if (prev_playback.is_valid()) { + prev_playback->current_transition = current_transition; + prev_playback->force_auto_advance = true; + } } } @@ -883,10 +885,6 @@ void AnimationNodeStateMachine::_rename_transitions(const StringName &p_name, co void AnimationNodeStateMachine::get_node_list(List *r_nodes) const { List nodes; for (const KeyValue &E : states) { - if (E.key == end_node && prev_state_machine == nullptr) { - continue; - } - nodes.push_back(E.key); } nodes.sort_custom(); -- cgit v1.2.3