Skip to content

Commit

Permalink
Merge pull request #89686 from kleonc/unique-node-names-check-owned-t…
Browse files Browse the repository at this point in the history
…hen-in-owner

Always look for unique node names in owner if not found in owned nodes
  • Loading branch information
akien-mga committed Mar 24, 2024
2 parents 8f91369 + 95ced4b commit 9d8697a
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions scene/main/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
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 {
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 {
next = nullptr;
const Node *const *node = current->data.children.getptr(name);
Expand Down

0 comments on commit 9d8697a

Please sign in to comment.