1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Avoid saving scene while already saving the scene

This commit is contained in:
kobewi
2023-11-20 21:57:21 +01:00
parent fa1fb2a53e
commit d84ba48d8f
2 changed files with 7 additions and 0 deletions

View File

@@ -1761,6 +1761,10 @@ static void _reset_animation_mixers(Node *p_node, List<Pair<AnimationMixer *, Re
}
void EditorNode::_save_scene(String p_file, int idx) {
if (!saving_scene.is_empty() && saving_scene == p_file) {
return;
}
Node *scene = editor_data.get_edited_scene_root(idx);
if (!scene) {
@@ -1817,7 +1821,9 @@ void EditorNode::_save_scene(String p_file, int idx) {
emit_signal(SNAME("scene_saved"), p_file);
_save_external_resources();
saving_scene = p_file; // Some editors may save scenes of built-in resources as external data, so avoid saving this scene again.
editor_data.save_editor_external_data();
saving_scene = "";
for (Pair<AnimationMixer *, Ref<AnimatedValuesBackup>> &E : anim_backups) {
E.first->restore(E.second);