summaryrefslogtreecommitdiff
path: root/scene/animation
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-31 17:40:38 +0200
committerGitHub <noreply@github.com>2022-08-31 17:40:38 +0200
commitfbf8632556b2c22b3916b444406ea0c75728eab7 (patch)
tree50db9482f9f35e91bc444b9db326d7ed985f8403 /scene/animation
parent10aec9057c104b493d74dd3e815439abbac3db69 (diff)
parent15b5bc88e247d4d7d461b7495af77019387959a0 (diff)
Merge pull request #64247 from guilhermefelipecgs/fix_end_node
Re-add AnimationNodeStateMachine::end_node for root state machine
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_node_state_machine.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp
index 4982afb59f..c4e13afac9 100644
--- a/scene/animation/animation_node_state_machine.cpp
+++ b/scene/animation/animation_node_state_machine.cpp
@@ -611,11 +611,13 @@ double AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *p_s
if (p_state_machine->end_node != current) {
rem = 1;
} else {
- Ref<AnimationNodeStateMachinePlayback> prev_playback = p_state_machine->prev_state_machine->get_parameter("playback");
+ if (p_state_machine->prev_state_machine != nullptr) {
+ Ref<AnimationNodeStateMachinePlayback> 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;
+ }
}
}
@@ -900,10 +902,6 @@ void AnimationNodeStateMachine::_rename_transitions(const StringName &p_name, co
void AnimationNodeStateMachine::get_node_list(List<StringName> *r_nodes) const {
List<StringName> nodes;
for (const KeyValue<StringName, State> &E : states) {
- if (E.key == end_node && prev_state_machine == nullptr) {
- continue;
- }
-
nodes.push_back(E.key);
}
nodes.sort_custom<StringName::AlphCompare>();