From b17d12c86f3e7414673d653396d2dce2e862b1e3 Mon Sep 17 00:00:00 2001 From: "cedeel@gmail.com" Date: Sun, 3 Jun 2012 23:35:17 +0000 Subject: Updated zlib, added chat formatting, fixed upside down stairs and slabs, fixed makefiles, hopefully updated vc project files git-svn-id: http://mc-server.googlecode.com/svn/trunk@546 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cClientHandle.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'source/cClientHandle.cpp') 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: -- cgit v1.2.3