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

addition/subtraction with > and < signs in huds is always true (?) #383

Open
haha-goodone-lol opened this issue Jun 14, 2024 · 1 comment
Labels
question Further information is requested

Comments

@haha-goodone-lol
Copy link

if x + y < z where z is less than x + y, e.g. if 1 + 10 < 5
will always run even though x + y is not less than z
to reproduce:
put a file in basewf/huds/test.hud with this below and do cg_clientHUD test

setFontFamily con_fontSystem
setFontSize con_fontSystemSmall

setScale #DEFAULTSCALE

setCursor #WIDTH / 2, #HEIGHT / 2
setFontSize 10 
if 2 + 4 < 3
    include crosshair
endif

only happens with + or -, not * or /

GelmoSan — Today at 18:06
What if you use parenthesis
I'm curious if these have different results:

if 2 + 4 < 3
    include crosshair
endif
if 4 + 2 < 3
    include crosshair
endif

gauley — Today at 18:22
if (2 + 4) < 3 still happens
if (4 + 2) < 3 still happens

if 2 + 4 < 3 still happens
if 4 + 2 < 3 still happens
gonna make an issue about that
still happens in warsow btw
okay, greater than sign also is broken

@Gelmo
Copy link
Member

Gelmo commented Jun 14, 2024

I did a quick grep of official huds, and none of them use + in if statements. This must be a known issue from long ago

@Warfork Warfork added bug Something isn't working question Further information is requested and removed bug Something isn't working labels Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants