From bffad5043619d143d595806122dc625746126ed8 Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 31 Jul 2014 18:41:48 +0200 Subject: Fixed water from ice and removed packed ice drop. --- src/Blocks/BlockIce.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockIce.h b/src/Blocks/BlockIce.h index c50623594..c085e9290 100644 --- a/src/Blocks/BlockIce.h +++ b/src/Blocks/BlockIce.h @@ -24,9 +24,19 @@ public: } - virtual void OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override + virtual void OnDestroyedByPlayer(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) override { - // TODO: Ice destroyed with air below it should turn into air instead of water + if (a_Player->IsGameModeCreative() || (a_BlockY <= 0)) + { + return; + } + + BLOCKTYPE BlockBelow = a_ChunkInterface.GetBlock(a_BlockX, a_BlockY - 1, a_BlockZ); + if (!cBlockInfo::IsSolid(BlockBelow) && !IsBlockLava(BlockBelow) && !IsBlockWater(BlockBelow)) + { + return; + } + a_ChunkInterface.FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_WATER, 0); // This is called later than the real destroying of this ice block } -- cgit v1.2.3 From 87d195171a7069139cbbc9dfc2534ddd6c1ad867 Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 31 Jul 2014 23:08:08 +0200 Subject: Changed IsSolid to FullyOccupiesVoxel --- src/Blocks/BlockIce.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockIce.h b/src/Blocks/BlockIce.h index c085e9290..c38630fe3 100644 --- a/src/Blocks/BlockIce.h +++ b/src/Blocks/BlockIce.h @@ -32,7 +32,7 @@ public: } BLOCKTYPE BlockBelow = a_ChunkInterface.GetBlock(a_BlockX, a_BlockY - 1, a_BlockZ); - if (!cBlockInfo::IsSolid(BlockBelow) && !IsBlockLava(BlockBelow) && !IsBlockWater(BlockBelow)) + if (!cBlockInfo::FullyOccupiesVoxel(BlockBelow) && !IsBlockLiquid(BlockBelow)) { return; } -- cgit v1.2.3