diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-06 20:22:25 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-06 20:22:25 +0100 |
commit | 57b8b3851179dacb1c07aba5808d61ba51d9b435 (patch) | |
tree | 8a396bc04a6f5ebc8e4654b48430fe79e3c66e7c /src/ClientHandle.cpp | |
parent | Fixed pickups spawning for BlockEntities (diff) | |
download | cuberite-57b8b3851179dacb1c07aba5808d61ba51d9b435.tar cuberite-57b8b3851179dacb1c07aba5808d61ba51d9b435.tar.gz cuberite-57b8b3851179dacb1c07aba5808d61ba51d9b435.tar.bz2 cuberite-57b8b3851179dacb1c07aba5808d61ba51d9b435.tar.lz cuberite-57b8b3851179dacb1c07aba5808d61ba51d9b435.tar.xz cuberite-57b8b3851179dacb1c07aba5808d61ba51d9b435.tar.zst cuberite-57b8b3851179dacb1c07aba5808d61ba51d9b435.zip |
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r-- | src/ClientHandle.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 95d8f23e5..bcd0f7192 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -685,12 +685,10 @@ void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_Bloc int pX = a_BlockX; int pY = a_BlockY; int pZ = a_BlockZ; - AddFaceDirection(pX, pY, pZ, a_BlockFace); + AddFaceDirection(pX, pY, pZ, a_BlockFace); // Get the block in front of the clicked coordinates (m_bInverse defaulted to false) Handler = cBlockHandler::GetBlockHandler(World->GetBlock(pX, pY, pZ)); - - // 2013_01_05 _X: This looks weird - // Why do we ask the block "behind" the one being clicked if it is clicked through? Shouldn't we ask the primary block instead? + if (Handler->IsClickedThrough()) { Handler->OnDigging(World, m_Player, pX, pY, pZ); @@ -886,7 +884,10 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, c ) ) { - // Coordinates at CLICKED block, don't move them anywhere + // Coordinates at clicked block, which was an eligible slab, and either top or bottom faces were clicked + // If clicked top face and slab occupies the top voxel, we want a slab to be placed above it (therefore increment Y) + // Else if clicked bottom face and slab occupies the bottom voxel, decrement Y for the same reason + // Don't touch coordinates if anything else because a dblslab opportunity is present if((ClickedBlockMeta & 0x08) && (a_BlockFace == BLOCK_FACE_TOP)) { ++a_BlockY; |