summaryrefslogtreecommitdiffstats
path: root/src/Entities/FallingBlock.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-05-01 20:50:40 +0200
committerTycho <work.tycho+git@gmail.com>2014-05-01 20:50:40 +0200
commit8780b324ff075f17358b01bc3615da0397fbe8be (patch)
treed448ab665fd50cca3861e06654f8668a89c8d953 /src/Entities/FallingBlock.cpp
parentAdded Testing capability (diff)
parentFixed MSVC2013 compilation. (diff)
downloadcuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.gz
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.bz2
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.lz
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.xz
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.zst
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.zip
Diffstat (limited to 'src/Entities/FallingBlock.cpp')
-rw-r--r--src/Entities/FallingBlock.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Entities/FallingBlock.cpp b/src/Entities/FallingBlock.cpp
index e57c45eaf..103e24b77 100644
--- a/src/Entities/FallingBlock.cpp
+++ b/src/Entities/FallingBlock.cpp
@@ -86,7 +86,9 @@ void cFallingBlock::Tick(float a_Dt, cChunk & a_Chunk)
AddSpeedY(MilliDt * -9.8f);
AddPosition(GetSpeed() * MilliDt);
- if ((GetSpeedX() != 0) || (GetSpeedZ() != 0))
+ // If not static (One billionth precision) broadcast movement.
+ static const float epsilon = 0.000000001f;
+ if ((fabs(GetSpeedX()) > epsilon) || (fabs(GetSpeedZ()) > epsilon))
{
BroadcastMovementUpdate();
}