]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Round z-vel used for comparison for jumpspeed
authorotta8634 <k9wolf@pm.me>
Thu, 5 Dec 2024 01:55:28 +0000 (09:55 +0800)
committerotta8634 <k9wolf@pm.me>
Thu, 5 Dec 2024 01:55:28 +0000 (09:55 +0800)
Suggested by @drjaska to eliminate most floating point imprecision

qcsrc/client/hud/panel/physics.qc

index 7b2823662e9f4843f7294158d77d81fdb447b796..852c25e66ac908ea6dd1c35a06d519387800c0e4 100644 (file)
@@ -177,7 +177,7 @@ void HUD_Physics()
                }
                else
                {
-                       if (vel_phys.z > prev_vel_z)
+                       if (floor(vel_phys.z + 0.5) > floor(prev_vel_z + 0.5))
                        {
                                // NOTE: this includes some situations where the player doesn't explicitly jump
                                jump_speed = prev_speed2d;