From: otta8634 Date: Thu, 5 Dec 2024 01:55:28 +0000 (+0800) Subject: Round z-vel used for comparison for jumpspeed X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f3626a636dea83d03f4684b1ef7bda212c34eb85;p=xonotic%2Fxonotic-data.pk3dir.git Round z-vel used for comparison for jumpspeed Suggested by @drjaska to eliminate most floating point imprecision --- 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;