From fb7c60ec11fde185d30ae6cc59e8c85756f85b8f Mon Sep 17 00:00:00 2001 From: faketruth Date: Sun, 4 Mar 2012 13:54:33 +0000 Subject: Changed signed char to unsigned char in block packets, so we can receive height up to 255 Blocks placed above 128 limit don't become obsidian anymore. This was due to the cChunk::MakeIndex() function return 0 when outside of bounds, it now returns an 'error constant' git-svn-id: http://mc-server.googlecode.com/svn/trunk@356 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cClientHandle.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/cClientHandle.cpp') diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index 9f054aec2..f27ca9e61 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -823,16 +823,18 @@ void cClientHandle::HandleBlockDig(cPacket_BlockDig * a_Packet) return; } - int pX = a_Packet->m_PosX, pY = a_Packet->m_PosY, pZ = a_Packet->m_PosZ; + int pX = a_Packet->m_PosX; + unsigned char pY = a_Packet->m_PosY; + int pZ = a_Packet->m_PosZ; - AddDirection(pX, (char &) pY, pZ, a_Packet->m_Direction); + AddDirection(pX, pY, pZ, a_Packet->m_Direction); char PossibleBlock = World->GetBlock(pX, pY, pZ); if (PossibleBlock == E_BLOCK_FIRE) { a_Packet->m_PosX = pX; - a_Packet->m_PosY = (char)pY; + a_Packet->m_PosY = pY; a_Packet->m_PosZ = pZ; bBroken = true; } @@ -1299,7 +1301,7 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet) else if (IsValidBlock(a_Packet->m_ItemType)) { int X = a_Packet->m_PosX; - char Y = a_Packet->m_PosY; + int Y = a_Packet->m_PosY; int Z = a_Packet->m_PosZ; AddDirection(X, Y, Z, a_Packet->m_Direction); -- cgit v1.2.3