Fixes crash when AnimationPlayer reset on save
(cherry picked from commit 96f077a18d
)
This commit is contained in:
parent
ac40f5bb75
commit
cdaae2abfb
1 changed files with 3 additions and 1 deletions
|
@ -1485,7 +1485,9 @@ static void _reset_animation_players(Node *p_node, List<Ref<AnimatedValuesBackup
|
|||
AnimationPlayer *player = Object::cast_to<AnimationPlayer>(p_node->get_child(i));
|
||||
if (player && player->is_reset_on_save_enabled() && player->can_apply_reset()) {
|
||||
Ref<AnimatedValuesBackup> old_values = player->apply_reset();
|
||||
r_anim_backups->push_back(old_values);
|
||||
if (old_values.is_valid()) {
|
||||
r_anim_backups->push_back(old_values);
|
||||
}
|
||||
}
|
||||
_reset_animation_players(p_node->get_child(i), r_anim_backups);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue