From b9bade8db1bf0445ce879ba6e1823d8266e60b2d Mon Sep 17 00:00:00 2001 From: twobit Date: Sun, 17 Mar 2024 22:44:05 -0400 Subject: [PATCH] fixes crash on nodes with internal children --- 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 906c397b5cd..3c2e328d641 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1823,7 +1823,7 @@ void Node::reparent(Node *p_parent, bool p_keep_global_transform) { Node *check = to_visit[to_visit.size() - 1]; to_visit.resize(to_visit.size() - 1); - for (int i = 0; i < check->get_child_count(); i++) { + for (int i = 0; i < check->get_child_count(false); i++) { Node *child = check->get_child(i, false); to_visit.push_back(child); if (child->data.owner == owner_temp) {