mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 20:23:53 +00:00
Always look for unique node names in owner if not found in owned nodes
(cherry picked from commit 95ced4bbdc
)
This commit is contained in:
parent
54393c53f3
commit
b045a7c92e
@ -1448,23 +1448,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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user