summaryrefslogtreecommitdiffstats
path: root/source/Player.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-03 20:05:11 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-03 20:05:11 +0100
commit01b24d73eab6b0e708063d82f01ea9bb9296550c (patch)
tree6646ddda7a137b8960484b9fa2614683545e756a /source/Player.cpp
parentSimulators are woken up upon chunk load (diff)
downloadcuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.gz
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.bz2
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.lz
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.xz
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.zst
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.zip
Diffstat (limited to '')
-rw-r--r--source/Player.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/Player.cpp b/source/Player.cpp
index f00b0768c..e84eee899 100644
--- a/source/Player.cpp
+++ b/source/Player.cpp
@@ -165,7 +165,7 @@ void cPlayer::Tick(float a_Dt, MTRand & a_TickRandom)
}
super::Tick(a_Dt, a_TickRandom);
-
+
if (m_bDirtyOrientation && !m_bDirtyPosition)
{
m_World->BroadcastEntLook(*this, m_ClientHandle);
@@ -558,6 +558,16 @@ void cPlayer::TeleportTo(double a_PosX, double a_PosY, double a_PosZ)
void cPlayer::MoveTo( const Vector3d & a_NewPos )
{
+ if (m_AttachedTo != NULL)
+ {
+ // When attached to an entity, the client sends position packets with weird coords:
+ // Y = -999 and X, Z = attempting to create speed, usually up to 0.03
+ Vector3d AddSpeed(a_NewPos);
+ AddSpeed.y = 0;
+ m_AttachedTo->AddSpeed(AddSpeed);
+ return;
+ }
+
// TODO: should do some checks to see if player is not moving through terrain
// TODO: Official server refuses position packets too far away from each other, kicking "hacked" clients; we should, too