summaryrefslogtreecommitdiff
path: root/scene/main/node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/node.cpp')
-rw-r--r--scene/main/node.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 6b46ffd8ad..50f3bf834f 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -1268,7 +1268,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)) {
- move_child(p_child, p_node->get_position_in_parent() + 1);
+ move_child(p_child, p_node->get_index() + 1);
} else {
WARN_PRINT("Cannot move under node " + p_node->get_name() + " as " + p_child->get_name() + " does not share a parent.");
}
@@ -1918,6 +1918,7 @@ int Node::get_index() const {
return data.pos;
}
+
void Node::remove_and_skip() {
ERR_FAIL_COND(!data.parent);
@@ -2042,11 +2043,6 @@ bool Node::get_scene_instance_load_placeholder() const {
return data.use_placeholder;
}
-int Node::get_position_in_parent() const {
-
- return data.pos;
-}
-
Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const {
Node *node = nullptr;
@@ -2215,7 +2211,7 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const
}
parent->add_child(dup);
- int pos = E->get()->get_position_in_parent();
+ int pos = E->get()->get_index();
if (pos < parent->get_child_count() - 1) {
@@ -2860,7 +2856,6 @@ void Node::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_pause_mode"), &Node::get_pause_mode);
ClassDB::bind_method(D_METHOD("can_process"), &Node::can_process);
ClassDB::bind_method(D_METHOD("print_stray_nodes"), &Node::_print_stray_nodes);
- ClassDB::bind_method(D_METHOD("get_position_in_parent"), &Node::get_position_in_parent);
ClassDB::bind_method(D_METHOD("set_display_folded", "fold"), &Node::set_display_folded);
ClassDB::bind_method(D_METHOD("is_displayed_folded"), &Node::is_displayed_folded);