1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix more clang-tidy reported problems for performance-type-promotion-in-math-fn

Based on 361714253 output
This commit is contained in:
Loic Blot 2018-04-03 21:58:29 +02:00
parent 67a4cb7d8a
commit 4827f754ec
No known key found for this signature in database
GPG key ID: EFAA458E8C153987
3 changed files with 25 additions and 24 deletions

View file

@ -18,7 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "localplayer.h"
#include <cmath>
#include "event.h"
#include "collision.h"
#include "nodedef.h"
@ -941,8 +941,8 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
v2f node_p2df(pf.X, pf.Z);
f32 distance_f = player_p2df.getDistanceFrom(node_p2df);
f32 max_axis_distance_f = MYMAX(
fabs(player_p2df.X - node_p2df.X),
fabs(player_p2df.Y - node_p2df.Y));
std::fabs(player_p2df.X - node_p2df.X),
std::fabs(player_p2df.Y - node_p2df.Y));
if (distance_f > min_distance_f ||
max_axis_distance_f > 0.5 * BS + sneak_max + 0.1 * BS)