-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix recursive Node.find_children
#75459
Conversation
@kleonc does this PR need anything else like a test or something before it can be reviewed? Anything I can do to help? |
It can be reviewed as is (feel free to do so). But I guess I could add some test case with nested nodes for |
5fa446a
to
d159123
Compare
@Maran23 Yeah, it should fix #63757 as well. But it doesn't change anything for the nodes without an Line 241 in de416c5
I think ignoring whole subtrees for the nodes without an owner is intentional. Otherwise (by not ignoring the whole subtree like in #63785) the children of the dynamically instantiated scenes would still be checked, only the root nodes of such scenes would be ignored. Changing this behavior seems like a compat breaking change to me, hence I'll leave it as is. Could always be tweaked in another PR (if it's actually not intended). |
Thanks! |
In
Node.find_children
method when the name of a child node was not matching the passed in non-empty pattern it resulted in not reachingif (recursive)
block because of thecontinue
to the next iteration:godot/scene/main/node.cpp
Lines 1417 to 1419 in 23394be
This PR fixes this logic to always get to the
if (recursive)
block so no children will be unintentionally skipped.Fixes #75446. Fixes #63757.
Supersedes #63785.