1
0

Even more fixes [SEE DESC]

* Fixed minecarts breaking completely due to stuff
* Rails are now non solid again
+ Added IsRail inline bool
- Removed Herobrine
This commit is contained in:
Tiger Wang
2013-09-12 23:57:02 +01:00
parent a39564a46a
commit 22b8f3a2e0
4 changed files with 62 additions and 23 deletions

View File

@@ -12,6 +12,7 @@
#include "../Simulator/FluidSimulator.h"
#include "../PluginManager.h"
#include "../Tracer.h"
#include "Minecart.h"
@@ -553,6 +554,11 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
{
fallspeed = m_Gravity * a_Dt / 3; // Fall 3x slower in water.
}
else if ((IsBlockRail(BlockBelow)) && (IsMinecart())) // Rails aren't solid, except for Minecarts
{
fallspeed = 0;
m_bOnGround = true;
}
else if (BlockIn == E_BLOCK_COBWEB)
{
NextSpeed.y *= 0.05; // Reduce overall falling speed
@@ -567,25 +573,40 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
}
else
{
if (
(BlockBelow != E_BLOCK_RAIL) &&
(BlockBelow != E_BLOCK_DETECTOR_RAIL) &&
(BlockBelow != E_BLOCK_POWERED_RAIL) &&
(BlockBelow != E_BLOCK_ACTIVATOR_RAIL)
)
if (IsMinecart())
{
// Friction
if (NextSpeed.SqrLength() > 0.0004f)
if (!IsBlockRail(BlockBelow))
{
NextSpeed.x *= 0.7f / (1 + a_Dt);
if (fabs(NextSpeed.x) < 0.05)
// Friction if minecart is off track, otherwise, Minecart.cpp handles this
if (NextSpeed.SqrLength() > 0.0004f)
{
NextSpeed.x = 0;
NextSpeed.x *= 0.7f / (1 + a_Dt);
if (fabs(NextSpeed.x) < 0.05)
{
NextSpeed.x = 0;
}
NextSpeed.z *= 0.7f / (1 + a_Dt);
if (fabs(NextSpeed.z) < 0.05)
{
NextSpeed.z = 0;
}
}
NextSpeed.z *= 0.7f / (1 + a_Dt);
if (fabs(NextSpeed.z) < 0.05)
}
else
{
// Friction
if (NextSpeed.SqrLength() > 0.0004f)
{
NextSpeed.z = 0;
NextSpeed.x *= 0.7f / (1 + a_Dt);
if (fabs(NextSpeed.x) < 0.05)
{
NextSpeed.x = 0;
}
NextSpeed.z *= 0.7f / (1 + a_Dt);
if (fabs(NextSpeed.z) < 0.05)
{
NextSpeed.z = 0;
}
}
}
}