From 6b05f8f602e4b00f6da9ce82acd2269c582812b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Botero?= <0xafbf@gmail.com> Date: Sat, 11 Jul 2020 15:57:17 -0500 Subject: [PATCH] Fix parent check for add_child_below_node --- scene/main/node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 05cd5910a61..0d516ce4f09 100644 --- a/scene/main/node.cpp +++ b/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.");