summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorChris Darnell <chris@cedeel.com>2014-09-22 09:22:36 +0200
committerChris Darnell <chris@cedeel.com>2014-09-22 09:22:36 +0200
commit195b646aa4189ec9858f4994754eadd2c05ef9df (patch)
treee39037971290a1b9fa6343c0c8f846541096d435 /src/Entities
parentQtBiomeVisualiser: Added the base for INI editting. (diff)
downloadcuberite-195b646aa4189ec9858f4994754eadd2c05ef9df.tar
cuberite-195b646aa4189ec9858f4994754eadd2c05ef9df.tar.gz
cuberite-195b646aa4189ec9858f4994754eadd2c05ef9df.tar.bz2
cuberite-195b646aa4189ec9858f4994754eadd2c05ef9df.tar.lz
cuberite-195b646aa4189ec9858f4994754eadd2c05ef9df.tar.xz
cuberite-195b646aa4189ec9858f4994754eadd2c05ef9df.tar.zst
cuberite-195b646aa4189ec9858f4994754eadd2c05ef9df.zip
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/Entity.cpp4
-rw-r--r--src/Entities/Minecart.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 42b207c48..996f2fff3 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -260,7 +260,7 @@ void cEntity::TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_R
void cEntity::SetYawFromSpeed(void)
{
const double EPS = 0.0000001;
- if ((abs(m_Speed.x) < EPS) && (abs(m_Speed.z) < EPS))
+ if ((std::abs(m_Speed.x) < EPS) && (std::abs(m_Speed.z) < EPS))
{
// atan2() may overflow or is undefined, pick any number
SetYaw(0);
@@ -277,7 +277,7 @@ void cEntity::SetPitchFromSpeed(void)
{
const double EPS = 0.0000001;
double xz = sqrt(m_Speed.x * m_Speed.x + m_Speed.z * m_Speed.z); // Speed XZ-plane component
- if ((abs(xz) < EPS) && (abs(m_Speed.y) < EPS))
+ if ((std::abs(xz) < EPS) && (std::abs(m_Speed.y) < EPS))
{
// atan2() may overflow or is undefined, pick any number
SetPitch(0);
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp
index 1501eea84..bc9e21d8e 100644
--- a/src/Entities/Minecart.cpp
+++ b/src/Entities/Minecart.cpp
@@ -876,7 +876,7 @@ bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
Vector3d Distance = MinecartCollisionCallback.GetCollidedEntityPosition() - Vector3d(GetPosX(), 0, GetPosZ());
// Prevent division by small numbers
- if (abs(Distance.z) < 0.001)
+ if (std::abs(Distance.z) < 0.001)
{
Distance.z = 0.001;
}
@@ -925,7 +925,7 @@ bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
Vector3d Distance = MinecartCollisionCallback.GetCollidedEntityPosition() - Vector3d(GetPosX(), 0, GetPosZ());
// Prevent division by small numbers
- if (abs(Distance.z) < 0.001)
+ if (std::abs(Distance.z) < 0.001)
{
Distance.z = 0.001;
}