summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-11-22 13:59:37 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-11-22 13:59:37 +0100
commit51bca1b586ca8f3d0f18eea6a9ef42a68c8fb3dc (patch)
treefd983e0245928b90e1d757270e1a0510ad250996
parent1faf2f5bfe97edcb606d82b81094cb35e2b8e18c (diff)
parentd84ba48d8f26522e74c18b5c57182f7cb0236dcb (diff)
downloadredot-engine-51bca1b586ca8f3d0f18eea6a9ef42a68c8fb3dc.tar.gz
Merge pull request #85154 from KoBeWi/yo_dawg_I_heard_you_like_saving_scen-JUST_STOP_IT
Avoid saving scene while already saving the scene
-rw-r--r--editor/editor_node.cpp6
-rw-r--r--editor/editor_node.h1
2 files changed, 7 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);
diff --git a/editor/editor_node.h b/editor/editor_node.h
index d4a8fc9aa8..956058ecfc 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -481,6 +481,7 @@ private:
String _tmp_import_path;
String external_file;
String open_navigate;
+ String saving_scene;
DynamicFontImportSettings *fontdata_import_settings = nullptr;
SceneImportSettings *scene_import_settings = nullptr;