summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-06-29 10:19:33 +0200
committerGitHub <noreply@github.com>2022-06-29 10:19:33 +0200
commitd631ee3307990a94c75d687fe2269af031886f4b (patch)
treeadb96fa32a15a14849a23e8e603d3d1a4821b023 /scene
parent90bed51d1c7855338dabac8f29ea7cbcbf2f1e4b (diff)
parenta73882305ce1eacb9795e95b48118b7bb745b796 (diff)
Merge pull request #62510 from MinusKube/animation-reset-crash
Fix animation player crashing when caching disabled tracks
Diffstat (limited to 'scene')
-rw-r--r--scene/animation/animation_player.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 2afe9ac35f..2e87dbf9da 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -283,10 +283,12 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim, Node *p_root_ov
setup_pass++;
for (int i = 0; i < a->get_track_count(); i++) {
+ p_anim->node_cache.write[i] = nullptr;
+
if (!a->track_is_enabled(i)) {
continue;
}
- p_anim->node_cache.write[i] = nullptr;
+
Ref<Resource> resource;
Vector<StringName> leftover_path;
Node *child = parent->get_node_and_resource(a->track_get_path(i), resource, leftover_path);