summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-13 23:37:09 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-13 23:37:09 +0100
commita66e154b90a96d41fd2cc0c9ac30f2e55e692546 (patch)
treeb92f4eb297cd22616ad6f47930128f2a710449e8 /src/Entities/Entity.cpp
parentDetaching improvements (diff)
downloadcuberite-a66e154b90a96d41fd2cc0c9ac30f2e55e692546.tar
cuberite-a66e154b90a96d41fd2cc0c9ac30f2e55e692546.tar.gz
cuberite-a66e154b90a96d41fd2cc0c9ac30f2e55e692546.tar.bz2
cuberite-a66e154b90a96d41fd2cc0c9ac30f2e55e692546.tar.lz
cuberite-a66e154b90a96d41fd2cc0c9ac30f2e55e692546.tar.xz
cuberite-a66e154b90a96d41fd2cc0c9ac30f2e55e692546.tar.zst
cuberite-a66e154b90a96d41fd2cc0c9ac30f2e55e692546.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.cpp44
1 files changed, 8 insertions, 36 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index bc66305b1..cd97c6766 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -629,11 +629,6 @@ 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
@@ -648,41 +643,18 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
}
else
{
- 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.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.x = 0;
}
- }
- else
- {
- // Friction for non-minecarts
- if (NextSpeed.SqrLength() > 0.0004f)
+ NextSpeed.z *= 0.7f / (1 + a_Dt);
+ if (fabs(NextSpeed.z) < 0.05)
{
- 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;
}
}
}