Browse Source

Merge pull request #14652 from hoelzl/pr-moved-instanced-children

Prevent users from moving instanced children
Rémi Verschelde 7 years ago
parent
commit
f73f10dd7e
1 changed files with 5 additions and 3 deletions
  1. 5 3
      editor/scene_tree_editor.cpp

+ 5 - 3
editor/scene_tree_editor.cpp

@@ -774,9 +774,11 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from
 
 
 		Node *n = get_node(np);
 		Node *n = get_node(np);
 		if (n) {
 		if (n) {
-
-			selected.push_back(n);
-			icons.push_back(next->get_icon(0));
+			// Only allow selection if not part of an instanced scene.
+			if (!n->get_owner() || n->get_owner() == get_scene_node() || n->get_owner()->get_filename() == String()) {
+				selected.push_back(n);
+				icons.push_back(next->get_icon(0));
+			}
 		}
 		}
 		next = tree->get_next_selected(next);
 		next = tree->get_next_selected(next);
 	}
 	}