From 1e910022291df03d5bc92b88d6a526e1bc0f095e Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 28 Aug 2013 22:13:27 +0100 Subject: Fixed Minecart spawning issues Now you can have everything! --- source/Protocol/Protocol14x.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'source/Protocol/Protocol14x.cpp') diff --git a/source/Protocol/Protocol14x.cpp b/source/Protocol/Protocol14x.cpp index 881a55717..c31a21c42 100644 --- a/source/Protocol/Protocol14x.cpp +++ b/source/Protocol/Protocol14x.cpp @@ -229,21 +229,24 @@ void cProtocol146::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, -void cProtocol146::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleType) +void cProtocol146::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleTypeType) { cCSLock Lock(m_CSPacket); - WriteByte(PACKET_SPAWN_OBJECT); - WriteInt (a_Vehicle.GetUniqueID()); - WriteByte(a_VehicleType); - WriteInt ((int)(a_Vehicle.GetPosX() * 32)); - WriteInt ((int)(a_Vehicle.GetPosY() * 32)); - WriteInt ((int)(a_Vehicle.GetPosZ() * 32)); + WriteByte (PACKET_SPAWN_OBJECT); + WriteInt (a_Vehicle.GetUniqueID()); + WriteByte (a_VehicleType); + WriteInt ((int)(a_Vehicle.GetPosX() * 32)); + WriteInt ((int)(a_Vehicle.GetPosY() * 32)); + WriteInt ((int)(a_Vehicle.GetPosZ() * 32)); WriteByte ((Byte)((a_Vehicle.GetPitch() / 360.f) * 256)); WriteByte ((Byte)((a_Vehicle.GetRotation() / 360.f) * 256)); - WriteInt (1); - WriteShort((short)(a_Vehicle.GetSpeedX() * 400)); - WriteShort((short)(a_Vehicle.GetSpeedY() * 400)); - WriteShort((short)(a_Vehicle.GetSpeedZ() * 400)); + WriteInt (a_VehicleTypeType); + if (a_VehicleTypeType != 0) + { + WriteShort((short)(a_Vehicle.GetSpeedX() * 400)); + WriteShort((short)(a_Vehicle.GetSpeedY() * 400)); + WriteShort((short)(a_Vehicle.GetSpeedZ() * 400)); + } Flush(); } -- cgit v1.2.3 From 7056992d0d99fde627e00c5d7f524cad0a70073d Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 29 Aug 2013 13:47:22 +0100 Subject: Implemented xoft's suggestions [SEE DESC] Rail metas are now in BlockID and exported to LUA Minecart now does a SetMass, instead of m_Mass Minecarts use SubType instead of TypeType --- source/Protocol/Protocol14x.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/Protocol/Protocol14x.cpp') diff --git a/source/Protocol/Protocol14x.cpp b/source/Protocol/Protocol14x.cpp index c31a21c42..ba9d7c01a 100644 --- a/source/Protocol/Protocol14x.cpp +++ b/source/Protocol/Protocol14x.cpp @@ -229,7 +229,7 @@ void cProtocol146::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, -void cProtocol146::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleTypeType) +void cProtocol146::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) { cCSLock Lock(m_CSPacket); WriteByte (PACKET_SPAWN_OBJECT); @@ -240,8 +240,8 @@ void cProtocol146::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleTyp WriteInt ((int)(a_Vehicle.GetPosZ() * 32)); WriteByte ((Byte)((a_Vehicle.GetPitch() / 360.f) * 256)); WriteByte ((Byte)((a_Vehicle.GetRotation() / 360.f) * 256)); - WriteInt (a_VehicleTypeType); - if (a_VehicleTypeType != 0) + WriteInt (a_VehicleSubType); + if (a_VehicleSubType != 0) { WriteShort((short)(a_Vehicle.GetSpeedX() * 400)); WriteShort((short)(a_Vehicle.GetSpeedY() * 400)); -- cgit v1.2.3