From: terencehill <piuntn@gmail.com>
Date: Mon, 20 Nov 2017 15:50:46 +0000 (+0100)
Subject: Don't display a negative 0 as acceleration value in the physics panel, make it positi... 
X-Git-Tag: xonotic-v0.8.5~2438
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=875918d5732859d78cc46e6beef66347c43e8c33;p=xonotic%2Fxonotic-data.pk3dir.git

Don't display a negative 0 as acceleration value in the physics panel, make it positive (existing workaround was broken)
---

diff --git a/qcsrc/client/hud/panel/physics.qc b/qcsrc/client/hud/panel/physics.qc
index e1fffb59f3..a6c65183d4 100644
--- a/qcsrc/client/hud/panel/physics.qc
+++ b/qcsrc/client/hud/panel/physics.qc
@@ -88,10 +88,10 @@ void HUD_Physics()
 	const int acc_decimals = 2;
 	if(time > physics_update_time)
 	{
+		discrete_acceleration = acceleration;
 		// workaround for ftos_decimals returning a negative 0
 		if(discrete_acceleration > -1 / (10 ** acc_decimals) && discrete_acceleration < 0)
 			discrete_acceleration = 0;
-		discrete_acceleration = acceleration;
 		discrete_speed = speed;
 		physics_update_time += autocvar_hud_panel_physics_update_interval;
 		if(physics_update_time < time)