From 53ff372624e31028e61cdf72a82945fe935bb420 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 19 Dec 2013 15:57:35 +0000 Subject: Fixed dust from being placed on nonsolids --- src/Blocks/BlockRedstone.h | 2 +- src/Items/ItemRedstoneDust.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Blocks/BlockRedstone.h b/src/Blocks/BlockRedstone.h index 57bd91b46..1bd9995f2 100644 --- a/src/Blocks/BlockRedstone.h +++ b/src/Blocks/BlockRedstone.h @@ -20,7 +20,7 @@ public: virtual bool CanBeAt(int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override { - return ((a_RelY > 0) && g_BlockIsSolid[a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ)]); + return ((a_RelY > 0) && g_BlockIsTorchPlaceable[a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ)]); } diff --git a/src/Items/ItemRedstoneDust.h b/src/Items/ItemRedstoneDust.h index b7860b187..38bf00ba6 100644 --- a/src/Items/ItemRedstoneDust.h +++ b/src/Items/ItemRedstoneDust.h @@ -27,6 +27,11 @@ public: BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta ) override { + if (!g_BlockIsTorchPlaceable[a_World->GetBlock(a_BlockX, a_BlockY - 1, a_BlockZ)]) // Some solid blocks, such as cocoa beans, are not suitable for dust + { + return false; + } + a_BlockType = E_BLOCK_REDSTONE_WIRE; a_BlockMeta = 0; return true; -- cgit v1.2.3