Explorar o código

Prevent to add node to selection when node is not inside tree

(cherry picked from commit 4857eabddb3eda7fef9ee3740a0325265209c640)
volzhs %!s(int64=9) %!d(string=hai) anos
pai
achega
cd8beea3bf
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      tools/editor/editor_data.cpp

+ 1 - 1
tools/editor/editor_data.cpp

@@ -834,7 +834,7 @@ void EditorSelection::_node_removed(Node *p_node) {
 void EditorSelection::add_node(Node *p_node) {
 
 	ERR_FAIL_NULL(p_node);
-
+	ERR_FAIL_COND(!p_node->is_inside_tree());
 	if (selection.has(p_node))
 		return;