diff options
author | kobewi <kobewi4e@gmail.com> | 2023-11-20 21:57:21 +0100 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2023-11-20 21:57:21 +0100 |
commit | d84ba48d8f26522e74c18b5c57182f7cb0236dcb (patch) | |
tree | dcae5a868775ffcb12ed95308246b9df0e6387f1 /editor/editor_node.cpp | |
parent | fa1fb2a53e20a3aec1ed1ffcc516f880f74db1a6 (diff) | |
download | redot-engine-d84ba48d8f26522e74c18b5c57182f7cb0236dcb.tar.gz |
Avoid saving scene while already saving the scene
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 6012ff1f70..b6c97f0c8f 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -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); |