diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-08 15:02:45 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-08 15:02:45 +0100 |
commit | 1d554677b49e7b2b2121b3fc4e3665a8be7bf710 (patch) | |
tree | d39d3790b018e0e8f04e81be1a2bc3870b3dae2a /src/Entities/Entity.cpp | |
parent | Fixed tabcompletion packet, fixes #356 (diff) | |
parent | Fixed normalizing large angles. (diff) | |
download | cuberite-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.cpp | 11 |
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); } |