Skip to content
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

Single underscore node name is ignored when using the $ get_node() shorthand #94310

Closed
zhyrin0 opened this issue Jul 13, 2024 · 1 comment · Fixed by #94327
Closed

Single underscore node name is ignored when using the $ get_node() shorthand #94310

zhyrin0 opened this issue Jul 13, 2024 · 1 comment · Fixed by #94327

Comments

@zhyrin0
Copy link

zhyrin0 commented Jul 13, 2024

Tested versions

4.3.beta1, 4.3.beta3

System information

Linux Mint 21.3 (Virginia)

Issue description

When working with $ shorthand node paths in gdscript, a single underscore node name gets ignored.
Example:

SceneRoot
\- _
   \- Node
\- Sibling
   \- _
      \- Node

Here, $_/Node gets recognised as /Node, $Sibling/_/Node gets recognised as Sibling/Node.

Steps to reproduce

  • Create a scene
  • Add a child, name it _
  • Add a grandchild
  • In gdscript, try accessing the grandchild with the $ get_node() shorthand, such as $_/<Grandchildname>

Minimal reproduction project (MRP)

bugreport_underscore_nodename_absolute_path.zip

@HolonProduction
Copy link
Member

Regression from #87634 or b4d0a09 to be more precise.

Also probably related, the following script:

extends Node

func _init() -> void:
	self._

Triggers a leftover print_line which says "Empty identifier found.". Haven't looked into it in depth but the common point between parse_identifier and parse_get_node seems to be previous.get_identifier(); which I suspect is empty in this cases for some reason, instead of containing _.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Bad
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants