From f3626a636dea83d03f4684b1ef7bda212c34eb85 Mon Sep 17 00:00:00 2001 From: otta8634 Date: Thu, 5 Dec 2024 09:55:28 +0800 Subject: [PATCH] Round z-vel used for comparison for jumpspeed Suggested by @drjaska to eliminate most floating point imprecision --- qcsrc/client/hud/panel/physics.qc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcsrc/client/hud/panel/physics.qc b/qcsrc/client/hud/panel/physics.qc index 7b2823662..852c25e66 100644 --- a/qcsrc/client/hud/panel/physics.qc +++ b/qcsrc/client/hud/panel/physics.qc @@ -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; -- 2.39.2