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

UniqueIDs get replaced if the code contains an enum of the same name #40

Open
powertomato opened this issue Jan 11, 2025 · 2 comments · May be fixed by #43
Open

UniqueIDs get replaced if the code contains an enum of the same name #40

powertomato opened this issue Jan 11, 2025 · 2 comments · May be fixed by #43
Labels
bug Something isn't working

Comments

@powertomato
Copy link

Obfuscation breaks in case a script references a node by a UniqueID, which happens to be an enum.

E.g. the following snippet

extends Node

enum SameNameAsANode {A,B}

func test() -> SameNameAsANode:
	return SameNameAsANode.A if %SameNameAsANode.visible else SameNameAsANode.B

Results in:

extends Node
func drc()->ewf:
	return ewf.mcj if%ewf.visible else ewf.djf
enum ewf{mcj,djf}

It should either be return ewf.mcj if%SameNameAsANode.visible else ewf.djf or it should also rename the node within the .tscn files.

It's a common pattern within my code to have a drop down and a corresponding enum to improve readability in code.

My workaround is to rename the enum or node.

@cherriesandmochi cherriesandmochi added the bug Something isn't working label Jan 13, 2025
@cherriesandmochi
Copy link
Owner

NodePaths should never get obfuscated in the first place, looks like I made a mistake somewhere.

@cherriesandmochi
Copy link
Owner

Ahh okay, the accessed symbols of a NodePath still need to get obfuscated, that's probably why this happens. I probably just forgot to exclude the NodePath itself from obfuscating.

bloodwiing added a commit to bloodwiing/gdmaim that referenced this issue Feb 3, 2025
@bloodwiing bloodwiing linked a pull request Feb 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants