TeamForbiddenLLC / warfork-qfusion

Warfork is powered by Qfusion a 3D game engine. Qfusion is a fork of id Tech 2, popularly known as the Quake II engine. Qfusion is free and open-source software subject to the terms of the GNU General Public License.
https://warfork.com
110 stars 45 forks source link

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

Open haha-goodone-lol opened 4 months ago

haha-goodone-lol commented 4 months ago

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 commented 4 months ago

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