]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Restore ** operator instead of pow, optimize check by allowing an operand to be const...
authorterencehill <piuntn@gmail.com>
Thu, 18 May 2017 13:17:36 +0000 (15:17 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 18 May 2017 13:17:36 +0000 (15:17 +0200)
qcsrc/client/hud/panel/physics.qc

index 67be2ac68646484292b026eac75d1eecb3d42233..f34bff3b8342e9e25a4b50183664d46d9849eb22 100644 (file)
@@ -82,11 +82,11 @@ void HUD_Physics()
                }
        }
 
-       int acc_decimals = 2;
+       const int acc_decimals = 2;
        if(time > physics_update_time)
        {
                // workaround for ftos_decimals returning a negative 0
-               if(discrete_acceleration > -1 / pow(10, acc_decimals) && discrete_acceleration < 0)
+               if(discrete_acceleration > -1 / (10 ** acc_decimals) && discrete_acceleration < 0)
                        discrete_acceleration = 0;
                discrete_acceleration = acceleration;
                discrete_speed = speed;