summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Piveteau <chripiveteau@gmail.com>2014-08-24 15:03:02 +0200
committerChristophe Piveteau <chripiveteau@gmail.com>2014-08-24 15:03:02 +0200
commita56634799e1fb7eef3d2817bd7d9c1b42969e934 (patch)
tree9d93a22d70b0951acf05c7df35adafefe31230d3
parentAdjust comment formatting (diff)
downloadcuberite-a56634799e1fb7eef3d2817bd7d9c1b42969e934.tar
cuberite-a56634799e1fb7eef3d2817bd7d9c1b42969e934.tar.gz
cuberite-a56634799e1fb7eef3d2817bd7d9c1b42969e934.tar.bz2
cuberite-a56634799e1fb7eef3d2817bd7d9c1b42969e934.tar.lz
cuberite-a56634799e1fb7eef3d2817bd7d9c1b42969e934.tar.xz
cuberite-a56634799e1fb7eef3d2817bd7d9c1b42969e934.tar.zst
cuberite-a56634799e1fb7eef3d2817bd7d9c1b42969e934.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Minecart.cpp32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp
index 13469edb3..f43c4d163 100644
--- a/src/Entities/Minecart.cpp
+++ b/src/Entities/Minecart.cpp
@@ -889,35 +889,31 @@ bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
((Distance.z > 0) && ((Distance.x / Distance.z) >= 1)) ||
((Distance.z < 0) && ((Distance.x / Distance.z) <= 1))
)
- // Moving -X +Z
{
+ // Moving -X +Z
if ((-GetSpeedX() * 0.4 / sqrt(2)) < 0.01)
- // ~ speedX >= 0
{
- // Immobile or not moving in the "right" direction. Give it a bump!
+ // ~ SpeedX >= 0 Immobile or not moving in the "right" direction. Give it a bump!
AddSpeedX(-4 / sqrt(2));
AddSpeedZ(4 / sqrt(2));
}
else
- // ~ SpeedX < 0
{
- // Moving in the "right" direction. Only accelerate it a bit.
+ // ~ SpeedX < 0 Moving in the "right" direction. Only accelerate it a bit.
SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
}
}
else if ((GetSpeedX() * 0.4 / sqrt(2)) < 0.01)
- // Moving +X -Z
- // ~ SpeedX <= 0
{
- // Immobile or not moving in the "right" direction
+ // Moving +X -T
+ // ~ SpeedX <= 0 Immobile or not moving in the "right" direction
AddSpeedX(4 / sqrt(2));
AddSpeedZ(-4 / sqrt(2));
}
else
- // ~ SpeedX > 0
{
- // Moving in the "right" direction
+ // ~ SpeedX > 0 Moving in the "right" direction
SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
}
@@ -942,35 +938,31 @@ bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
((Distance.z > 0) && ((Distance.x / Distance.z) <= -1)) ||
((Distance.z < 0) && ((Distance.x / Distance.z) >= -1))
)
- // Moving +X +Z
{
+ // Moving +X +Z
if ((GetSpeedX() * 0.4) < 0.01)
- // ~ SpeedX <= 0
{
- // Immobile or not moving in the "right" direction
+ // ~ SpeedX <= 0 Immobile or not moving in the "right" direction
AddSpeedX(4 / sqrt(2));
AddSpeedZ(4 / sqrt(2));
}
else
- // SpeedX > 0
{
- // Moving in the "right" direction
+ // ~ SpeedX > 0 Moving in the "right" direction
SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
}
}
else if ((-GetSpeedX() * 0.4) < 0.01)
- // Moving -X -Z
- // ~ SpeedX >= 0
{
- // Immobile or not moving in the "right" direction
+ // Moving -X -Z
+ // ~ SpeedX >= 0 Immobile or not moving in the "right" direction
AddSpeedX(-4 / sqrt(2));
AddSpeedZ(-4 / sqrt(2));
}
else
- // ~ SpeedX < 0
{
- // Moving in the "right" direction
+ // ~ SpeedX < 0 Moving in the "right" direction
SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
}