-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
GDScript 2.0: Casting to Zero when using property #65675
Comments
|
Seems connected to Proposal 844 godotengine/godot-proposals#844 |
Digging a little into this one since I can still replicate it :) It appears that there is no conversion happening between the int from the getter and the float f = Value
print(typeof(f) == TYPE_INT) if you ad this print statement, it will print Furthermore, in those conditions it appears that the constructor for the variant of type int might actually skip a few steps and forget to assign the value? I'm digging in a little more. |
Ok, so I got a fix in, but I'm not convinced it's completely thorough. Essentially getters were not their return address types in the compiler, meaning that the compiler wouldn't know to create an Somehow I still believe that it's possible to fool the compiler into creating an Which also doesn't solve problem number 2, which is that calling |
Godot version
4.0.16
System information
Windows 10
Issue description
When using a property and casting the value from an INT to a FLOAT, produces very strange result.
See to step to replicate.
It seems when we assign a property to a float, the internal variable type is corrupted.
Steps to reproduce
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: