summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-21 00:17:49 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-21 00:17:49 +0200
commit8e153f6689880da1380af1bf9d858d1d3a8461bb (patch)
treedb967bb98a0de0414dc72774d2740575e9c63829 /source
parentFixed broken carpet handler [SEE DESC] (diff)
downloadcuberite-8e153f6689880da1380af1bf9d858d1d3a8461bb.tar
cuberite-8e153f6689880da1380af1bf9d858d1d3a8461bb.tar.gz
cuberite-8e153f6689880da1380af1bf9d858d1d3a8461bb.tar.bz2
cuberite-8e153f6689880da1380af1bf9d858d1d3a8461bb.tar.lz
cuberite-8e153f6689880da1380af1bf9d858d1d3a8461bb.tar.xz
cuberite-8e153f6689880da1380af1bf9d858d1d3a8461bb.tar.zst
cuberite-8e153f6689880da1380af1bf9d858d1d3a8461bb.zip
Diffstat (limited to 'source')
-rw-r--r--source/Blocks/BlockSlab.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/Blocks/BlockSlab.h b/source/Blocks/BlockSlab.h
index f34f42bae..dd80da27e 100644
--- a/source/Blocks/BlockSlab.h
+++ b/source/Blocks/BlockSlab.h
@@ -35,7 +35,18 @@ public:
NIBBLETYPE Meta = (NIBBLETYPE)(a_Player->GetEquippedItem().m_ItemDamage & 0x07);
switch (a_BlockFace)
{
- case BLOCK_FACE_TOP: a_BlockMeta = Meta & 0x7; break; // Always bottom half of the slab when placing on top of something
+ case BLOCK_FACE_TOP:
+ {
+ if (a_World->GetBlock(a_BlockX, a_BlockY - 1, a_BlockZ) == E_BLOCK_STONE_SLAB)
+ {
+ a_World->FastSetBlock(a_BlockX, a_BlockY - 1, a_BlockZ, E_BLOCK_DOUBLE_STONE_SLAB, Meta);
+ a_BlockType = E_BLOCK_AIR;
+ }
+ else
+ {
+ a_BlockMeta = Meta & 0x7; break; // Always bottom half of the slab when placing on top of something
+ }
+ }
case BLOCK_FACE_BOTTOM: a_BlockMeta = Meta | 0x8; break; // Always top half of the slab when placing on bottom of something
case BLOCK_FACE_EAST:
case BLOCK_FACE_NORTH: