From fe745e2fff9b252dc51b50c858b1ae7b736ee106 Mon Sep 17 00:00:00 2001 From: kobewi Date: Tue, 7 Sep 2021 22:19:45 +0200 Subject: [PATCH] Close built-in script from any scene (cherry picked from commit 1a605096998ca33c84946eca0834e8a7963656a7) --- editor/editor_data.cpp | 4 ++++ editor/editor_node.cpp | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 75eddae76cb..3595e4cc54b 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -543,6 +543,10 @@ void EditorData::remove_scene(int p_idx) { current_edited_scene--; } + if (edited_scene[p_idx].path != String()) { + ScriptEditor::get_singleton()->close_builtin_scripts_from_scene(edited_scene[p_idx].path); + } + edited_scene.remove(p_idx); } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 07508ffbdbb..0caa57bf473 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3275,10 +3275,6 @@ void EditorNode::_remove_edited_scene(bool p_change_tab) { new_index = 1; } - if (editor_data.get_scene_path(old_index) != String()) { - ScriptEditor::get_singleton()->close_builtin_scripts_from_scene(editor_data.get_scene_path(old_index)); - } - if (p_change_tab) { _scene_tab_changed(new_index); }