summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-12-08 13:08:56 +0100
committermadmaxoft <github@xoft.cz>2013-12-08 13:08:56 +0100
commit6785bb7c165b1d5be87ebf414d877c774eeac708 (patch)
tree717963e13a3453a5daa4927006b327daf73ddd38 /src/Entities
parentMoved bindings-related to a Bindings subfolder. (diff)
downloadcuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar.gz
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar.bz2
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar.lz
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar.xz
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar.zst
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 91be6dd93..d728d6cbc 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -158,8 +158,7 @@ bool cEntity::Initialize(cWorld * a_World)
void cEntity::WrapHeadYaw(void)
{
- while (m_HeadYaw > 180.f) m_HeadYaw -= 360.f; // Wrap it
- while (m_HeadYaw < -180.f) m_HeadYaw += 360.f;
+ m_HeadYaw = NormalizeAngleDegrees(m_HeadYaw);
}
@@ -168,10 +167,8 @@ void cEntity::WrapHeadYaw(void)
void cEntity::WrapRotation(void)
{
- while (m_Rot.x > 180.f) m_Rot.x -= 360.f; // Wrap it
- while (m_Rot.x < -180.f) m_Rot.x += 360.f;
- while (m_Rot.y > 180.f) m_Rot.y -= 360.f;
- while (m_Rot.y < -180.f) m_Rot.y += 360.f;
+ m_Rot.x = NormalizeAngleDegrees(m_Rot.x);
+ m_Rot.y = NormalizeAngleDegrees(m_Rot.z);
}