summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-06-08 11:32:52 +0200
committermadmaxoft <github@xoft.cz>2014-06-08 11:32:52 +0200
commit28b82d5bbb4a0c7df901bea9e9f65a66186379ec (patch)
tree4be064d1420d7a89f89e1479eb3db0d2c5658dc4 /src
parentMerge pull request #1077 from mc-server/fuelfixes (diff)
downloadcuberite-28b82d5bbb4a0c7df901bea9e9f65a66186379ec.tar
cuberite-28b82d5bbb4a0c7df901bea9e9f65a66186379ec.tar.gz
cuberite-28b82d5bbb4a0c7df901bea9e9f65a66186379ec.tar.bz2
cuberite-28b82d5bbb4a0c7df901bea9e9f65a66186379ec.tar.lz
cuberite-28b82d5bbb4a0c7df901bea9e9f65a66186379ec.tar.xz
cuberite-28b82d5bbb4a0c7df901bea9e9f65a66186379ec.tar.zst
cuberite-28b82d5bbb4a0c7df901bea9e9f65a66186379ec.zip
Diffstat (limited to 'src')
-rw-r--r--src/ClientHandle.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index d47ceff0e..77f3b274a 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -1089,18 +1089,25 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e
cWorld * World = m_Player->GetWorld();
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)
+ (a_BlockFace != BLOCK_FACE_NONE) && // The client is interacting with a specific block
+ (
+ (Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) || // The block is too far away
+ (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) ||
+ (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6)
+ )
)
{
- if (a_BlockFace != BLOCK_FACE_NONE)
+ AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
+ World->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player);
+ if (a_BlockY < cChunkDef::Height - 1)
{
- AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
- World->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player);
World->SendBlockTo(a_BlockX, a_BlockY + 1, a_BlockZ, m_Player); // 2 block high things
- m_Player->GetInventory().SendEquippedSlot();
}
+ if (a_BlockY > 0)
+ {
+ World->SendBlockTo(a_BlockX, a_BlockY - 1, a_BlockZ, m_Player); // 2 block high things
+ }
+ m_Player->GetInventory().SendEquippedSlot();
return;
}