From 46e1228f73d37753c9b888d97f941084b6fb558b Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 3 Mar 2013 08:40:37 +0000 Subject: SandSimulator: Fixed sand dropping on half-slabs; added more blocks that break falling sand into pickups, fixed instant-fall git-svn-id: http://mc-server.googlecode.com/svn/trunk@1242 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/FallingBlock.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'source/FallingBlock.cpp') 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; -- cgit v1.2.3