Change comment formatting
This commit is contained in:
parent
c70886a712
commit
a56634799e
@ -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)) ||
|
||||||
((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)
|
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));
|
AddSpeedX(-4 / sqrt(2));
|
||||||
AddSpeedZ(4 / sqrt(2));
|
AddSpeedZ(4 / sqrt(2));
|
||||||
}
|
}
|
||||||
else
|
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));
|
SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
|
||||||
SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
|
SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((GetSpeedX() * 0.4 / sqrt(2)) < 0.01)
|
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));
|
AddSpeedX(4 / sqrt(2));
|
||||||
AddSpeedZ(-4 / sqrt(2));
|
AddSpeedZ(-4 / sqrt(2));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// ~ SpeedX > 0
|
|
||||||
{
|
{
|
||||||
// Moving in the "right" direction
|
// ~ SpeedX > 0 Moving in the "right" direction
|
||||||
SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
|
SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
|
||||||
SetSpeedZ(GetSpeedZ() * 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)) ||
|
||||||
((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)
|
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));
|
AddSpeedX(4 / sqrt(2));
|
||||||
AddSpeedZ(4 / sqrt(2));
|
AddSpeedZ(4 / sqrt(2));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// SpeedX > 0
|
|
||||||
{
|
{
|
||||||
// Moving in the "right" direction
|
// ~ SpeedX > 0 Moving in the "right" direction
|
||||||
SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
|
SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
|
||||||
SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
|
SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((-GetSpeedX() * 0.4) < 0.01)
|
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));
|
AddSpeedX(-4 / sqrt(2));
|
||||||
AddSpeedZ(-4 / sqrt(2));
|
AddSpeedZ(-4 / sqrt(2));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// ~ SpeedX < 0
|
|
||||||
{
|
{
|
||||||
// Moving in the "right" direction
|
// ~ SpeedX < 0 Moving in the "right" direction
|
||||||
SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
|
SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
|
||||||
SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
|
SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user