Skip to content

Commit 7a7f848

Browse files
committed
Util: Fix getting sub-scene's root path
Cuurently, it prepends the "/root/" to the node's name as the path, if the node is the scene's root node. But, the absolute path reference points to nothing and leads NULL accessment. So, do not reform the path for the root node of the scene.
1 parent d8d10ee commit 7a7f848

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

addons/block_code/ui/util.gd

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ static func node_scene_path(node: Node, reference: Node, path_root: Node = null)
3939
if node.unique_name_in_owner:
4040
# With unique_name_in_owner, just use the % prefixed name.
4141
return NodePath("%%%s" % node.name)
42-
elif node.is_ancestor_of(reference):
43-
# If the node is an ancestor of the reference, it would begin
44-
# with an ugly ../. Use an absolute path where /root is the
45-
# path_root node.
46-
return NodePath("/root/%s" % path_root.get_path_to(node))
4742
else:
4843
# The node is reference or a child of it. Use a relative path.
4944
return reference.get_path_to(node)

0 commit comments

Comments
 (0)