summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
authorcedeel@gmail.com <cedeel@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-04 01:35:17 +0200
committercedeel@gmail.com <cedeel@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-04 01:35:17 +0200
commitb17d12c86f3e7414673d653396d2dce2e862b1e3 (patch)
tree95225ff23d64c0ea4a621401b841efe55b5a6169 /source/cClientHandle.cpp
parentAdded planks into items.ini (diff)
downloadcuberite-b17d12c86f3e7414673d653396d2dce2e862b1e3.tar
cuberite-b17d12c86f3e7414673d653396d2dce2e862b1e3.tar.gz
cuberite-b17d12c86f3e7414673d653396d2dce2e862b1e3.tar.bz2
cuberite-b17d12c86f3e7414673d653396d2dce2e862b1e3.tar.lz
cuberite-b17d12c86f3e7414673d653396d2dce2e862b1e3.tar.xz
cuberite-b17d12c86f3e7414673d653396d2dce2e862b1e3.tar.zst
cuberite-b17d12c86f3e7414673d653396d2dce2e862b1e3.zip
Diffstat (limited to '')
-rw-r--r--source/cClientHandle.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 065bc0c79..5df31b36b 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -15,6 +15,7 @@
#include "cItem.h"
#include "cTorch.h"
#include "cStairs.h"
+#include "cStep.h"
#include "cDoors.h"
#include "cLadder.h"
#include "cSign.h"
@@ -1017,10 +1018,20 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet)
if (ClickedBlock == E_BLOCK_STEP)
{
- if (MetaData == m_Player->GetWorld()->GetBlockMeta(a_Packet->m_PosX, a_Packet->m_PosY, a_Packet->m_PosZ) && a_Packet->m_Direction == 1) //only make double slab if meta values are the same and if player clicked on top of the block (Dir = 1)
+ // Only make double slab if meta values are the same and if player clicked either on top or on bottom of the block (direction either 0 or 1)
+ // TODO check if it works from beneath
+ if (MetaData == ( m_Player->GetWorld()->GetBlockMeta(a_Packet->m_PosX, a_Packet->m_PosY, a_Packet->m_PosZ) & 0x7) && a_Packet->m_Direction <= 1)
+ //if (MetaData == m_Player->GetWorld()->GetBlockMeta(a_Packet->m_PosX, a_Packet->m_PosY, a_Packet->m_PosZ) && a_Packet->m_Direction == 1)
{
- a_Packet->m_ItemType = E_BLOCK_DOUBLE_STEP;
- a_Packet->m_PosY--;
+ a_Packet->m_ItemType = E_BLOCK_DOUBLE_STEP;
+ if(a_Packet->m_Direction == 1)
+ {
+ a_Packet->m_PosY--;
+ }
+ else
+ {
+ a_Packet->m_PosY++;
+ }
bIgnoreCollision = true;
}
}
@@ -1167,6 +1178,12 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet)
MetaData = cPiston::RotationPitchToMetaData(m_Player->GetRotation(), 0); // Same orientation as pistons, just ignore pitch
break;
}
+
+ case E_BLOCK_STEP:
+ {
+ MetaData += cStep::DirectionToMetaData( a_Packet->m_Direction );
+ break;
+ }
case E_BLOCK_COBBLESTONE_STAIRS:
case E_BLOCK_BRICK_STAIRS:
@@ -1174,7 +1191,7 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet)
case E_BLOCK_NETHER_BRICK_STAIRS:
case E_BLOCK_WOODEN_STAIRS:
{
- MetaData = cStairs::RotationToMetaData(m_Player->GetRotation());
+ MetaData = cStairs::RotationToMetaData(m_Player->GetRotation(), a_Packet->m_Direction);
break;
}
case E_BLOCK_LADDER: