Commit 3008a05
committed
Util: Make node_is_part_of_edited_scene safer
When switching to a different scene in the editor, the previous edited
scene root will no longer have a parent and you'll see a pile of "Cannot
call method 'is_ancestor_of' on a null value." errors from Godot. Unroll
the one liner to add the parent null check and use some intermediate
variables to remove duplicate method calls. Note that the
is_inside_tree() call is dropped since it's redundant to checking if
get_tree() returns null.1 parent 6f7bb2d commit 3008a05
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments