summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-08-22 15:32:27 +0200
committerHowaner <franzi.moos@googlemail.com>2014-08-22 15:32:27 +0200
commit8fa4ac9ad957d951cf25c668ffbb4e5d2fafa7f7 (patch)
tree0c307dc0a278c1839a7fd120da0bb1ed54f6a4d2
parentFixed a warning in FastRandom. (diff)
downloadcuberite-8fa4ac9ad957d951cf25c668ffbb4e5d2fafa7f7.tar
cuberite-8fa4ac9ad957d951cf25c668ffbb4e5d2fafa7f7.tar.gz
cuberite-8fa4ac9ad957d951cf25c668ffbb4e5d2fafa7f7.tar.bz2
cuberite-8fa4ac9ad957d951cf25c668ffbb4e5d2fafa7f7.tar.lz
cuberite-8fa4ac9ad957d951cf25c668ffbb4e5d2fafa7f7.tar.xz
cuberite-8fa4ac9ad957d951cf25c668ffbb4e5d2fafa7f7.tar.zst
cuberite-8fa4ac9ad957d951cf25c668ffbb4e5d2fafa7f7.zip
-rw-r--r--src/ClientHandle.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index ee4fdfa7d..8aa883144 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -922,11 +922,16 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB
return;
}
- // Check for clickthrough-blocks:
- /* When the user breaks a fire block, the client send the wrong block location.
- We must find the right block with the face direction. */
- if (a_BlockFace != BLOCK_FACE_NONE)
+ if ((a_Status == DIG_STATUS_STARTED) || (a_Status == DIG_STATUS_FINISHED))
{
+ if (a_BlockFace == BLOCK_FACE_NONE)
+ {
+ return;
+ }
+
+ /* Check for clickthrough-blocks:
+ When the user breaks a fire block, the client send the wrong block location.
+ We must find the right block with the face direction. */
int BlockX = a_BlockX;
int BlockY = a_BlockY;
int BlockZ = a_BlockZ;
@@ -937,17 +942,16 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB
a_BlockY = BlockY;
a_BlockZ = BlockZ;
}
- }
- if (
- ((a_Status == DIG_STATUS_STARTED) || (a_Status == DIG_STATUS_FINISHED)) && // Only do a radius check for block destruction - things like pickup tossing send coordinates that are to be ignored
- ((Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) ||
- (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) ||
- (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6))
- )
- {
- m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player);
- return;
+ if (
+ ((Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) ||
+ (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) ||
+ (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6))
+ )
+ {
+ m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player);
+ return;
+ }
}
cPluginManager * PlgMgr = cRoot::Get()->GetPluginManager();