summaryrefslogtreecommitdiff
path: root/src/content_sao.cpp
diff options
context:
space:
mode:
authorLoïc Blot <loic.blot@unix-experience.fr>2018-04-03 18:16:17 +0200
committerLoïc Blot <loic.blot@unix-experience.fr>2018-04-03 18:16:17 +0200
commit67a4cb7d8a4461fe7d5206189fd4e9539beb20b7 (patch)
tree059f4bea1f880c297a54b02d8f8e99bb77d1359f /src/content_sao.cpp
parentbaca933b6bcf8c321748defa19769a54b27a89ba (diff)
downloadminetest-67a4cb7d8a4461fe7d5206189fd4e9539beb20b7.tar.gz
minetest-67a4cb7d8a4461fe7d5206189fd4e9539beb20b7.tar.bz2
minetest-67a4cb7d8a4461fe7d5206189fd4e9539beb20b7.zip
Fix various clang-tidy reported performance-type-promotion-in-math-fn
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r--src/content_sao.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index 0e0c19fce..8f77d54c4 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -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);
}
}