Skip to content

Commit

Permalink
Always look for unique node names in owner if not found in owned nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
kleonc committed Mar 19, 2024
1 parent fe01776 commit 95ced4b
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 @@ -1679,23 +1679,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 95ced4b

Please sign in to comment.