1
0

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
This commit is contained in:
faketruth
2012-03-04 13:54:33 +00:00
parent ad89cf88ba
commit fb7c60ec11
9 changed files with 47 additions and 28 deletions

View File

@@ -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);