* Fix bad ordering in the PlaceBlockPacket.

This commit is contained in:
iProgramInCpp
2023-08-16 22:47:15 +03:00
parent 9a24abc603
commit 83c94f355e
2 changed files with 4 additions and 4 deletions

View File

@@ -211,8 +211,6 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& guid, MovePlayer
void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& guid, PlaceBlockPacket* packet)
{
puts_ignorable("PlaceBlockPacket");
Mob* pMob = (Mob*)m_pLevel->getEntity(packet->m_playerID);
if (!pMob)
return;
@@ -223,6 +221,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& guid, PlaceBlock
int y = packet->m_y;
int z = packet->m_z;
printf_ignorable("PlaceBlockPacket: %d", tile);
if (!m_pLevel->mayPlace(tile, x, y, z, true))
return;

View File

@@ -20,8 +20,8 @@ void PlaceBlockPacket::write(RakNet::BitStream* bs)
bs->Write(m_x);
bs->Write(m_z);
bs->Write(m_y);
bs->Write(m_tile);
bs->Write(m_face);
bs->Write(m_tile);
}
void PlaceBlockPacket::read(RakNet::BitStream* bs)
@@ -30,6 +30,6 @@ void PlaceBlockPacket::read(RakNet::BitStream* bs)
bs->Read(m_x);
bs->Read(m_z);
bs->Read(m_y);
bs->Read(m_tile);
bs->Read(m_face);
bs->Read(m_tile);
}