1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-12 16:58:39 +00:00

Fix various clang-tidy reported performance-type-promotion-in-math-fn

This commit is contained in:
Loïc Blot 2018-04-03 18:16:17 +02:00
parent baca933b6b
commit 67a4cb7d8a
8 changed files with 20 additions and 17 deletions

View file

@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "genericobject.h"
#include "settings.h"
#include <algorithm>
#include <cmath>
std::map<u16, ServerActiveObject::Factory> ServerActiveObject::m_types;
@ -411,8 +412,8 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
float move_d = m_base_position.getDistanceFrom(m_last_sent_position);
move_d += m_last_sent_move_precision;
float vel_d = m_velocity.getDistanceFrom(m_last_sent_velocity);
if(move_d > minchange || vel_d > minchange ||
fabs(m_yaw - m_last_sent_yaw) > 1.0){
if (move_d > minchange || vel_d > minchange ||
std::fabs(m_yaw - m_last_sent_yaw) > 1.0) {
sendPosition(true, false);
}
}