A few Minecart fixes
* Removed unneeded flatrail setpos * Fixed health checking
This commit is contained in:
parent
35efe9c727
commit
57c17a02db
@ -105,9 +105,6 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
|
|||||||
SpeedY = 0; // Don't move vertically as on ground
|
SpeedY = 0; // Don't move vertically as on ground
|
||||||
SpeedX = 0; // Correct diagonal movement from curved rails
|
SpeedX = 0; // Correct diagonal movement from curved rails
|
||||||
|
|
||||||
// Set Y as current Y rounded up to bypass friction
|
|
||||||
SetPosY(floor(GetPosY()));
|
|
||||||
|
|
||||||
if (SpeedZ != 0) // Don't do anything if cart is stationary
|
if (SpeedZ != 0) // Don't do anything if cart is stationary
|
||||||
{
|
{
|
||||||
if (SpeedZ > 0)
|
if (SpeedZ > 0)
|
||||||
@ -130,8 +127,6 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
|
|||||||
SpeedY = 0;
|
SpeedY = 0;
|
||||||
SpeedZ = 0;
|
SpeedZ = 0;
|
||||||
|
|
||||||
SetPosY(floor(GetPosY()));
|
|
||||||
|
|
||||||
if (SpeedX != 0)
|
if (SpeedX != 0)
|
||||||
{
|
{
|
||||||
if (SpeedX > 0)
|
if (SpeedX > 0)
|
||||||
@ -347,7 +342,7 @@ void cMinecart::DoTakeDamage(TakeDamageInfo & TDI)
|
|||||||
{
|
{
|
||||||
super::DoTakeDamage(TDI);
|
super::DoTakeDamage(TDI);
|
||||||
|
|
||||||
if (GetHealth() == 0)
|
if (GetHealth() <= 0)
|
||||||
{
|
{
|
||||||
Destroy(true);
|
Destroy(true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user