2
0
Эх сурвалжийг харах

Merge pull request #40300 from 0xafbf/fix-parent-check

Fix parent check for add_child_below_node
Rémi Verschelde 5 жил өмнө
parent
commit
37100384c3
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      scene/main/node.cpp

+ 1 - 1
scene/main/node.cpp

@@ -1189,7 +1189,7 @@ void Node::add_child_below_node(Node *p_node, Node *p_child, bool p_legible_uniq
 
 	add_child(p_child, p_legible_unique_name);
 
-	if (is_a_parent_of(p_node)) {
+	if (p_node->data.parent == this) {
 		move_child(p_child, p_node->get_position_in_parent() + 1);
 	} else {
 		WARN_PRINTS("Cannot move under node " + p_node->get_name() + " as " + p_child->get_name() + " does not share a parent.");