summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorSilvano Cerza <silvanocerza@gmail.com>2018-10-23 21:55:25 +0200
committerSilvano Cerza <silvanocerza@gmail.com>2018-10-24 11:27:41 +0200
commit7167394876a4fc34de29f1608300e05740297d1d (patch)
treec4a5ac224b9514bd55b69b98e9837d3aae683973 /editor
parent72db3000a56a6f85d348c218437d1a1dfc0953bf (diff)
Fixed user being unable to delete root Node if is an inherited Scene
User wasn't able to delete the root Node because it was being treated as a foreign Node since it was an inherited Scene
Diffstat (limited to 'editor')
-rw-r--r--editor/scene_tree_dock.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 45c20121da..a8f4c38695 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -1307,6 +1307,13 @@ bool SceneTreeDock::_validate_no_foreign() {
return false;
}
+ // When edited_scene inherits from another one the root Node will be the parent Scene,
+ // we don't want to consider that Node a foreign one otherwise we would not be able to
+ // delete it
+ if (edited_scene->get_scene_inherited_state().is_valid() && edited_scene == E->get()) {
+ continue;
+ }
+
if (edited_scene->get_scene_inherited_state().is_valid() && edited_scene->get_scene_inherited_state()->find_node_by_path(edited_scene->get_path_to(E->get())) >= 0) {
accept->set_text(TTR("Can't operate on nodes the current scene inherits from!"));