-
Notifications
You must be signed in to change notification settings - Fork 551
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
[BUG] double/float comparison not working #1658
Comments
I believe this is already fixed in 4.8.2. So try that. |
No dice. I just tried this in GZDoom 4.8.2, and float/double comparisons don't work properly in 4.8.2 either. |
I think this a float vs double precision issue. float: |
Was scale changed internally from double to float between GZDoom 4.7.1 and 4.8.0? |
Yes f9bf6f9 |
Does it work if |
Nope |
Looks like the scale vector needs to be reverted to double. Well, here goes the chance of saving some space in AActor... :( |
That's a shame, but it seems this unfortunately breaks stuff too much with no obvious workaround. |
Why not convert/coerce both values to float if either value being compared is a float? |
Currently there are no float opcodes whatsoever, this would require a lot of support code. |
fixed in aae1d14 |
Still a few floats in actor.zs causing zscript compilation to fail. EDIT: #1666 |
GZDoom version
GZDoom g4.8.1
Which game are you running with GZDoom?
Doom 2
What Operating System are you using?
Linux x86_64
Please describe your specific OS version
Kubuntu 20.04 LTS
Relevant hardware info
Intel Core i3-3110M CPU, Intel HD Graphics 4000 GPU
Have you checked that no other similar issue already exists?
A clear and concise description of what the bug is.
When doubles are compared to floats, the result is incorrect.
This has caused an issue in Wolfenstein: Blade of Agony where the player's disguise item makes them unable to move through doors or gates while crouching. I did a quick workaround, but that doesn't solve the issue.
The comparison works properly on GZDoom 4.7.1 because it converts the scale to doubles, but it does not work properly on GZDoom 4.8.1.
Here's a small mod demonstrating the issue.
Steps to reproduce the behaviour.
Explain how to reproduce
give ScaleCompareTest
into the console.Your configuration
No response
Provide a Log
GZDoom 4.7.1 (correct):
GZDoom 4.8.1 (incorrect):
The text was updated successfully, but these errors were encountered: