1
0

Change comment formatting

This commit is contained in:
Christophe Piveteau 2014-08-24 15:03:02 +02:00
parent c70886a712
commit a56634799e

View File

@ -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));
}