It goes up the gui tree rather than down.
Optimized IsOurChild's runtime
Why? It seems to that it is supposed to down the tree?
The current function checks all children of self (and those children's children) for equality with the argument.
The new function (supposedly) will check all parents of the argument (and those parent's parents) for equality with self.
Theoretically this could improve the runtime of this function a shit load, as it won't cause code to travel down any parent-child routes that aren't neccesary unlike the current code which travels down every parent-child route possible.
Use HasParent instead
Turns out there is a function doing pretty much the same but with the arguments swapped called pnl:HasParent(parent).
I updated the pr to use this function but I recommend to remove this function instead and replace it with HasParent.
Add if ( !IsValid( child ) ) then return false end to the first line.
if ( !IsValid( child ) ) then return false end