Merge pull request #89686 from kleonc/unique-node-names-check-owned-then-in-owner

Always look for unique node names in owner if not found in owned nodes
This commit is contained in:
Rémi Verschelde 2024-03-24 01:21:28 +01:00
commit 9d8697ab01
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1755,23 +1755,14 @@ Node *Node::get_node_or_null(const NodePath &p_path) const {
}
} else if (name.is_node_unique_name()) {
if (current->data.owned_unique_nodes.size()) {
// Has unique nodes in ownership
Node **unique = current->data.owned_unique_nodes.getptr(name);
if (!unique && current->data.owner) {
unique = current->data.owner->data.owned_unique_nodes.getptr(name);
}
if (!unique) {
return nullptr;
}
next = *unique;
} else if (current->data.owner) {
Node **unique = current->data.owner->data.owned_unique_nodes.getptr(name);
if (!unique) {
return nullptr;
}
next = *unique;
} else {
return nullptr;
}
} else {
next = nullptr;
const Node *const *node = current->data.children.getptr(name);