From 4f34704ce8b712bdb4c6fb05bfc2d70e769eb08d Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 6 Oct 2012 20:53:08 +0000 Subject: Fixed an invalid direction to AddDirection() ( http://forum.mc-server.org/showthread.php?tid=571&pid=4821#pid4821 ) git-svn-id: http://mc-server.googlecode.com/svn/trunk@939 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/ClientHandle.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'source/ClientHandle.cpp') 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); + } } } } -- cgit v1.2.3