summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-05-22 11:08:44 +0200
committerSTRWarrior <niels.breuker@hotmail.nl>2014-05-22 11:08:44 +0200
commit73455d293861c492388f3a28af3380318eaa0bae (patch)
treec31ce06aa2d2960d46f1b80c3cc7d8d2ecb4f424 /src/Entities/Player.cpp
parentBoth SetSpeed functions are now overridden by cPlayer (diff)
downloadcuberite-73455d293861c492388f3a28af3380318eaa0bae.tar
cuberite-73455d293861c492388f3a28af3380318eaa0bae.tar.gz
cuberite-73455d293861c492388f3a28af3380318eaa0bae.tar.bz2
cuberite-73455d293861c492388f3a28af3380318eaa0bae.tar.lz
cuberite-73455d293861c492388f3a28af3380318eaa0bae.tar.xz
cuberite-73455d293861c492388f3a28af3380318eaa0bae.tar.zst
cuberite-73455d293861c492388f3a28af3380318eaa0bae.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Player.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 48320b6c9..0d79ff533 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1255,6 +1255,9 @@ void cPlayer::ForceSetSpeed(const Vector3d & a_Speed)
void cPlayer::SetSpeed(const Vector3d & a_Speed)
{
m_Speed.Set(a_Speed.x, a_Speed.y, a_Speed.z);
+ WrapSpeed();
+
+ // Send the speed to the client so he actualy moves
m_ClientHandle->SendEntityVelocity(*this);
}
@@ -1265,6 +1268,48 @@ void cPlayer::SetSpeed(const Vector3d & a_Speed)
void cPlayer::SetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ)
{
m_Speed.Set(a_SpeedX, a_SpeedY, a_SpeedZ);
+ WrapSpeed();
+
+ // Send the speed to the client so he actualy moves
+ m_ClientHandle->SendEntityVelocity(*this);
+}
+
+
+
+
+
+void cPlayer::SetSpeedX(double a_SpeedX)
+{
+ m_Speed.x = a_SpeedX;
+ WrapSpeed();
+
+ // Send the speed to the client so he actualy moves
+ m_ClientHandle->SendEntityVelocity(*this);
+}
+
+
+
+
+
+void cPlayer::SetSpeedY(double a_SpeedY)
+{
+ m_Speed.y = a_SpeedY;
+ WrapSpeed();
+
+ // Send the speed to the client so he actualy moves
+ m_ClientHandle->SendEntityVelocity(*this);
+}
+
+
+
+
+
+void cPlayer::SetSpeedZ(double a_SpeedZ)
+{
+ m_Speed.z = a_SpeedZ;
+ WrapSpeed();
+
+ // Send the speed to the client so he actualy moves
m_ClientHandle->SendEntityVelocity(*this);
}