Example #1
0
void cProtocol146::SendSpawnFallingBlock(const cFallingBlock & a_FallingBlock)
{
	// Send a spawn object / vehicle packet
	cCSLock Lock(m_CSPacket);

	WriteByte(PACKET_SPAWN_OBJECT);
	WriteInt (a_FallingBlock.GetUniqueID());
	WriteByte(70);
	WriteInt ((int)(a_FallingBlock.GetPosX() * 32));
	WriteInt ((int)(a_FallingBlock.GetPosY() * 32));
	WriteInt ((int)(a_FallingBlock.GetPosZ() * 32));
	WriteByte (0);  // Pitch
	WriteByte (0);  // Yaw
	WriteInt (a_FallingBlock.GetBlockType());  // data indicator = blocktype
	WriteShort((short)(a_FallingBlock.GetSpeedX() * 400));
	WriteShort((short)(a_FallingBlock.GetSpeedY() * 400));
	WriteShort((short)(a_FallingBlock.GetSpeedZ() * 400));
	Flush();
}
Example #2
0
void cProtocol125::SendSpawnFallingBlock(const cFallingBlock & a_FallingBlock)
{
	// This protocol version implements falling blocks using the spawn object / vehicle packet:
	SendSpawnObject(a_FallingBlock, 70, a_FallingBlock.GetBlockType(), 0, 0);
}