summaryrefslogtreecommitdiffstats
path: root/src/Entities
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
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')
-rw-r--r--src/Entities/Entity.cpp11
-rw-r--r--src/Entities/Pickup.cpp2
-rw-r--r--src/Entities/Player.cpp2
3 files changed, 6 insertions, 9 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);
}
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp
index f8aae9703..001e386a7 100644
--- a/src/Entities/Pickup.cpp
+++ b/src/Entities/Pickup.cpp
@@ -12,7 +12,7 @@
#include "../Simulator/FluidSimulator.h"
#include "../Server.h"
#include "Player.h"
-#include "../PluginManager.h"
+#include "../Bindings/PluginManager.h"
#include "../Item.h"
#include "../Root.h"
#include "../Chunk.h"
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 4684567e6..7a5ff5696 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -8,7 +8,7 @@
#include "../UI/WindowOwner.h"
#include "../World.h"
#include "Pickup.h"
-#include "../PluginManager.h"
+#include "../Bindings/PluginManager.h"
#include "../BlockEntities/BlockEntity.h"
#include "../GroupManager.h"
#include "../Group.h"