summaryrefslogtreecommitdiffstats
path: root/source/FallingBlock.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-03 09:40:37 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-03 09:40:37 +0100
commit46e1228f73d37753c9b888d97f941084b6fb558b (patch)
tree28b0a2ad07813924c9848f9b9c564d36e4631189 /source/FallingBlock.cpp
parentcSandSimulator: implemented InstantFall (diff)
downloadcuberite-46e1228f73d37753c9b888d97f941084b6fb558b.tar
cuberite-46e1228f73d37753c9b888d97f941084b6fb558b.tar.gz
cuberite-46e1228f73d37753c9b888d97f941084b6fb558b.tar.bz2
cuberite-46e1228f73d37753c9b888d97f941084b6fb558b.tar.lz
cuberite-46e1228f73d37753c9b888d97f941084b6fb558b.tar.xz
cuberite-46e1228f73d37753c9b888d97f941084b6fb558b.tar.zst
cuberite-46e1228f73d37753c9b888d97f941084b6fb558b.zip
Diffstat (limited to '')
-rw-r--r--source/FallingBlock.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/FallingBlock.cpp b/source/FallingBlock.cpp
index 12362009d..8ad313bb9 100644
--- a/source/FallingBlock.cpp
+++ b/source/FallingBlock.cpp
@@ -64,12 +64,20 @@ void cFallingBlock::Tick(float a_Dt, MTRand & a_TickRandom)
if (BlockY < cChunkDef::Height - 1)
{
- BLOCKTYPE BlockBelow = GetWorld()->GetBlock(BlockX, BlockY, BlockZ);
- if (
- cSandSimulator::DoesBreakFallingThrough(BlockBelow) || // Fallen onto a block that breaks this into pickups (e. g. half-slab)
- !cSandSimulator::CanContinueFallThrough(BlockBelow) // Fallen onto a solid block
- )
+ BLOCKTYPE BlockBelow;
+ NIBBLETYPE BelowMeta;
+ GetWorld()->GetBlockTypeMeta(BlockX, BlockY, BlockZ, BlockBelow, BelowMeta);
+ if (cSandSimulator::DoesBreakFallingThrough(BlockBelow, BelowMeta))
{
+ // Fallen onto a block that breaks this into pickups (e. g. half-slab)
+ // Must finish the fall with coords one below the block:
+ cSandSimulator::FinishFalling(m_World, BlockX, BlockY, BlockZ, m_BlockType, m_BlockMeta);
+ Destroy();
+ return;
+ }
+ else if (!cSandSimulator::CanContinueFallThrough(BlockBelow))
+ {
+ // Fallen onto a solid block
cSandSimulator::FinishFalling(m_World, BlockX, BlockY + 1, BlockZ, m_BlockType, m_BlockMeta);
Destroy();
return;