1
0

Merge pull request #1771 from Raekye/master

Use DoSetSpeed in AddSpeed* in Entity.cpp
This commit is contained in:
Mattes D 2015-02-26 09:10:56 +01:00
commit e7708d483e

View File

@ -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) void cEntity::AddSpeed(double a_AddSpeedX, double a_AddSpeedY, double a_AddSpeedZ)
{ {
m_Speed.x += a_AddSpeedX; DoSetSpeed(m_Speed.x + a_AddSpeedX, m_Speed.y + a_AddSpeedY, m_Speed.z + a_AddSpeedZ);
m_Speed.y += a_AddSpeedY;
m_Speed.z += a_AddSpeedZ;
WrapSpeed();
} }
@ -1925,8 +1922,7 @@ void cEntity::AddSpeed(double a_AddSpeedX, double a_AddSpeedY, double a_AddSpeed
void cEntity::AddSpeedX(double a_AddSpeedX) void cEntity::AddSpeedX(double a_AddSpeedX)
{ {
m_Speed.x += a_AddSpeedX; AddSpeed(a_AddSpeedX, 0, 0);
WrapSpeed();
} }
@ -1935,8 +1931,7 @@ void cEntity::AddSpeedX(double a_AddSpeedX)
void cEntity::AddSpeedY(double a_AddSpeedY) void cEntity::AddSpeedY(double a_AddSpeedY)
{ {
m_Speed.y += a_AddSpeedY; AddSpeed(0, a_AddSpeedY, 0);
WrapSpeed();
} }
@ -1945,8 +1940,7 @@ void cEntity::AddSpeedY(double a_AddSpeedY)
void cEntity::AddSpeedZ(double a_AddSpeedZ) void cEntity::AddSpeedZ(double a_AddSpeedZ)
{ {
m_Speed.z += a_AddSpeedZ; AddSpeed(0, 0, a_AddSpeedZ);
WrapSpeed();
} }