Fixed a couple more warnings.
This commit is contained in:
parent
2c0bb7b717
commit
73edd2b961
@ -87,7 +87,9 @@ void cFallingBlock::Tick(float a_Dt, cChunk & a_Chunk)
|
||||
AddSpeedY(MilliDt * -9.8f);
|
||||
AddPosition(GetSpeed() * MilliDt);
|
||||
|
||||
if ((GetSpeedX() != 0) || (GetSpeedZ() != 0))
|
||||
//If not static (One billionth precision) broadcast movement.
|
||||
float epsilon = 0.000000001;
|
||||
if ((fabs(GetSpeedX()) > epsilon) || (fabs(GetSpeedZ()) > epsilon))
|
||||
{
|
||||
BroadcastMovementUpdate();
|
||||
}
|
||||
|
@ -234,18 +234,15 @@ void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt)
|
||||
bool BlckCol = TestBlockCollision(a_RailMeta), EntCol = TestEntityCollision(a_RailMeta);
|
||||
if (EntCol || BlckCol) return;
|
||||
|
||||
if (GetSpeedZ() != 0) // Don't do anything if cart is stationary
|
||||
if (GetSpeedZ() > 0)
|
||||
{
|
||||
if (GetSpeedZ() > 0)
|
||||
{
|
||||
// Going SOUTH, slow down
|
||||
AddSpeedZ(-0.1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Going NORTH, slow down
|
||||
AddSpeedZ(0.1);
|
||||
}
|
||||
// Going SOUTH, slow down
|
||||
AddSpeedZ(-0.1);
|
||||
}
|
||||
else if (GetSpeedZ() < 0)
|
||||
{
|
||||
// Going NORTH, slow down
|
||||
AddSpeedZ(0.1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -259,16 +256,13 @@ void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt)
|
||||
bool BlckCol = TestBlockCollision(a_RailMeta), EntCol = TestEntityCollision(a_RailMeta);
|
||||
if (EntCol || BlckCol) return;
|
||||
|
||||
if (GetSpeedX() != 0)
|
||||
if (GetSpeedX() > 0)
|
||||
{
|
||||
if (GetSpeedX() > 0)
|
||||
{
|
||||
AddSpeedX(-0.1);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddSpeedX(0.1);
|
||||
}
|
||||
AddSpeedX(-0.1);
|
||||
}
|
||||
else if (GetSpeedX() < 0)
|
||||
{
|
||||
AddSpeedX(0.1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user