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);
|
AddSpeedY(MilliDt * -9.8f);
|
||||||
AddPosition(GetSpeed() * MilliDt);
|
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();
|
BroadcastMovementUpdate();
|
||||||
}
|
}
|
||||||
|
@ -234,19 +234,16 @@ void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt)
|
|||||||
bool BlckCol = TestBlockCollision(a_RailMeta), EntCol = TestEntityCollision(a_RailMeta);
|
bool BlckCol = TestBlockCollision(a_RailMeta), EntCol = TestEntityCollision(a_RailMeta);
|
||||||
if (EntCol || BlckCol) return;
|
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
|
// Going SOUTH, slow down
|
||||||
AddSpeedZ(-0.1);
|
AddSpeedZ(-0.1);
|
||||||
}
|
}
|
||||||
else
|
else if (GetSpeedZ() < 0)
|
||||||
{
|
{
|
||||||
// Going NORTH, slow down
|
// Going NORTH, slow down
|
||||||
AddSpeedZ(0.1);
|
AddSpeedZ(0.1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E_META_RAIL_XM_XP: // EASTWEST
|
case E_META_RAIL_XM_XP: // EASTWEST
|
||||||
@ -259,17 +256,14 @@ void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt)
|
|||||||
bool BlckCol = TestBlockCollision(a_RailMeta), EntCol = TestEntityCollision(a_RailMeta);
|
bool BlckCol = TestBlockCollision(a_RailMeta), EntCol = TestEntityCollision(a_RailMeta);
|
||||||
if (EntCol || BlckCol) return;
|
if (EntCol || BlckCol) return;
|
||||||
|
|
||||||
if (GetSpeedX() != 0)
|
|
||||||
{
|
|
||||||
if (GetSpeedX() > 0)
|
if (GetSpeedX() > 0)
|
||||||
{
|
{
|
||||||
AddSpeedX(-0.1);
|
AddSpeedX(-0.1);
|
||||||
}
|
}
|
||||||
else
|
else if (GetSpeedX() < 0)
|
||||||
{
|
{
|
||||||
AddSpeedX(0.1);
|
AddSpeedX(0.1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E_META_RAIL_ASCEND_ZM: // ASCEND NORTH
|
case E_META_RAIL_ASCEND_ZM: // ASCEND NORTH
|
||||||
|
Loading…
Reference in New Issue
Block a user