1
0

ClientHandle: Fixed re-sending refused right-clicks.

The coords weren't checked against Y boundary and -1 coords weren't sent.
This fixes mc-server/Gallery#45.
This commit is contained in:
Mattes D 2015-04-19 17:33:58 +02:00
parent d40078d163
commit fd497b8269

View File

@ -1341,7 +1341,14 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e
{
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
if (a_BlockY < cChunkDef::Height - 1)
{
World->SendBlockTo(a_BlockX, a_BlockY + 1, a_BlockZ, m_Player); // 2 block high things
}
if (a_BlockY > 1)
{
World->SendBlockTo(a_BlockX, a_BlockY - 1, a_BlockZ, m_Player); // 2 block high things
}
m_Player->GetInventory().SendEquippedSlot();
}
}