From 57b8b3851179dacb1c07aba5808d61ba51d9b435 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 6 Dec 2013 19:22:25 +0000 Subject: Updated comments for slabs --- src/ClientHandle.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') 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; -- cgit v1.2.3