summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-02-26 09:10:56 +0100
committerMattes D <github@xoft.cz>2015-02-26 09:10:56 +0100
commite7708d483eee57fbdd457f566a97315a72fa09e3 (patch)
tree3e1474516761dacc253e9a497f68dd7975e4f3ea /src/Entities
parentFixed flowing water turning into ice when snowing (diff)
parentuse DoSetSpeed in AddSpeed* in Entity.cpp (diff)
downloadcuberite-e7708d483eee57fbdd457f566a97315a72fa09e3.tar
cuberite-e7708d483eee57fbdd457f566a97315a72fa09e3.tar.gz
cuberite-e7708d483eee57fbdd457f566a97315a72fa09e3.tar.bz2
cuberite-e7708d483eee57fbdd457f566a97315a72fa09e3.tar.lz
cuberite-e7708d483eee57fbdd457f566a97315a72fa09e3.tar.xz
cuberite-e7708d483eee57fbdd457f566a97315a72fa09e3.tar.zst
cuberite-e7708d483eee57fbdd457f566a97315a72fa09e3.zip
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/Entity.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index c51a27961..07cfb97b2 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -1913,10 +1913,7 @@ void cEntity::AddPosition(double a_AddPosX, double a_AddPosY, double a_AddPosZ)
void cEntity::AddSpeed(double a_AddSpeedX, double a_AddSpeedY, double a_AddSpeedZ)
{
- m_Speed.x += a_AddSpeedX;
- m_Speed.y += a_AddSpeedY;
- m_Speed.z += a_AddSpeedZ;
- WrapSpeed();
+ DoSetSpeed(m_Speed.x + a_AddSpeedX, m_Speed.y + a_AddSpeedY, m_Speed.z + a_AddSpeedZ);
}
@@ -1925,8 +1922,7 @@ void cEntity::AddSpeed(double a_AddSpeedX, double a_AddSpeedY, double a_AddSpeed
void cEntity::AddSpeedX(double a_AddSpeedX)
{
- m_Speed.x += a_AddSpeedX;
- WrapSpeed();
+ AddSpeed(a_AddSpeedX, 0, 0);
}
@@ -1935,8 +1931,7 @@ void cEntity::AddSpeedX(double a_AddSpeedX)
void cEntity::AddSpeedY(double a_AddSpeedY)
{
- m_Speed.y += a_AddSpeedY;
- WrapSpeed();
+ AddSpeed(0, a_AddSpeedY, 0);
}
@@ -1945,8 +1940,7 @@ void cEntity::AddSpeedY(double a_AddSpeedY)
void cEntity::AddSpeedZ(double a_AddSpeedZ)
{
- m_Speed.z += a_AddSpeedZ;
- WrapSpeed();
+ AddSpeed(0, 0, a_AddSpeedZ);
}