1
0

Fixed a couple more warnings.

This commit is contained in:
archshift 2014-04-25 17:15:12 -07:00
parent 2c0bb7b717
commit 73edd2b961
2 changed files with 17 additions and 21 deletions

View File

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

View File

@ -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