summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/ClientHandle.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index ad9401e79..f019fd862 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -571,15 +571,18 @@ void cClientHandle::HandleBlockDig(int a_BlockX, int a_BlockY, int a_BlockZ, cha
ItemHandler->OnDiggingBlock(World, m_Player, &Equipped, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
// Check for clickthrough-blocks:
- int pX = a_BlockX;
- int pY = a_BlockY;
- int pZ = a_BlockZ;
- AddDirection(pX, pY, pZ, a_BlockFace);
-
- Handler = cBlockHandler::GetBlockHandler(World->GetBlock(pX, pY, pZ));
- if (Handler->IsClickedThrough())
+ if (a_BlockFace != BLOCK_FACE_NONE)
{
- Handler->OnDigging(World, m_Player, pX, pY, pZ);
+ int pX = a_BlockX;
+ int pY = a_BlockY;
+ int pZ = a_BlockZ;
+ AddDirection(pX, pY, pZ, a_BlockFace);
+
+ Handler = cBlockHandler::GetBlockHandler(World->GetBlock(pX, pY, pZ));
+ if (Handler->IsClickedThrough())
+ {
+ Handler->OnDigging(World, m_Player, pX, pY, pZ);
+ }
}
}
}