summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-12-08 15:02:45 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-12-08 15:02:45 +0100
commit1d554677b49e7b2b2121b3fc4e3665a8be7bf710 (patch)
treed39d3790b018e0e8f04e81be1a2bc3870b3dae2a /src/Entities/Entity.cpp
parentFixed tabcompletion packet, fixes #356 (diff)
parentFixed normalizing large angles. (diff)
downloadcuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar
cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar.gz
cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar.bz2
cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar.lz
cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar.xz
cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar.zst
cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.zip
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r--src/Entities/Entity.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 3bea7bc01..d728d6cbc 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -10,7 +10,7 @@
#include "../ClientHandle.h"
#include "../Chunk.h"
#include "../Simulator/FluidSimulator.h"
-#include "../PluginManager.h"
+#include "../Bindings/PluginManager.h"
#include "../Tracer.h"
#include "Minecart.h"
@@ -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);
}