diff options
Diffstat (limited to 'src/Blocks/BlockDoor.h')
-rw-r--r-- | src/Blocks/BlockDoor.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 445383e7c..79ed4f723 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -55,6 +55,10 @@ public: virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { + if ((a_BlockMeta & 0x08) != 0) // is top part of door + { + return; + } switch (m_BlockType) { case E_BLOCK_WOODEN_DOOR: @@ -242,13 +246,13 @@ public: if ((Meta & 0x08) != 0) { // The coords are pointing at the top part of the door - if (a_BlockX > 0) + if (a_BlockY > 0) { NIBBLETYPE DownMeta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY - 1, a_BlockZ); - return (NIBBLETYPE) ((DownMeta & 0x07) | 0x08 | (Meta << 4)); + return static_cast<NIBBLETYPE>((DownMeta & 0x07) | 0x08 | (Meta << 4)); } // This is the top part of the door at the bottommost layer of the world, there's no bottom: - return (NIBBLETYPE) (0x08 | (Meta << 4)); + return static_cast<NIBBLETYPE>(0x08 | (Meta << 4)); } else { @@ -256,7 +260,7 @@ public: if (a_BlockY < cChunkDef::Height - 1) { NIBBLETYPE UpMeta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY + 1, a_BlockZ); - return (NIBBLETYPE) (Meta | (UpMeta << 4)); + return static_cast<NIBBLETYPE>(Meta | (UpMeta << 4)); } // This is the bottom part of the door at the topmost layer of the world, there's no top: return Meta; |