You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-25 15:37:42 +00:00
Fixes crash when AnimationPlayer reset on save
This commit is contained in:
@@ -1606,8 +1606,10 @@ static void _reset_animation_players(Node *p_node, List<Ref<AnimatedValuesBackup
|
|||||||
AnimationPlayer *player = Object::cast_to<AnimationPlayer>(p_node->get_child(i));
|
AnimationPlayer *player = Object::cast_to<AnimationPlayer>(p_node->get_child(i));
|
||||||
if (player && player->is_reset_on_save_enabled() && player->can_apply_reset()) {
|
if (player && player->is_reset_on_save_enabled() && player->can_apply_reset()) {
|
||||||
Ref<AnimatedValuesBackup> old_values = player->apply_reset();
|
Ref<AnimatedValuesBackup> old_values = player->apply_reset();
|
||||||
|
if (old_values.is_valid()) {
|
||||||
r_anim_backups->push_back(old_values);
|
r_anim_backups->push_back(old_values);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
_reset_animation_players(p_node->get_child(i), r_anim_backups);
|
_reset_animation_players(p_node->get_child(i), r_anim_backups);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user