diff options
author | madmaxoft <github@xoft.cz> | 2013-09-05 17:44:22 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-09-05 17:44:22 +0200 |
commit | cdaa48377846c688b4c003c35e02529ba00c779c (patch) | |
tree | dfb4d74621fc06768d4712dba4a297e6cc0e1b78 /source/Protocol/Protocol125.cpp | |
parent | Removed TimedWait from cEvent. (diff) | |
parent | Fixed inconsistent meta naming (diff) | |
download | cuberite-cdaa48377846c688b4c003c35e02529ba00c779c.tar cuberite-cdaa48377846c688b4c003c35e02529ba00c779c.tar.gz cuberite-cdaa48377846c688b4c003c35e02529ba00c779c.tar.bz2 cuberite-cdaa48377846c688b4c003c35e02529ba00c779c.tar.lz cuberite-cdaa48377846c688b4c003c35e02529ba00c779c.tar.xz cuberite-cdaa48377846c688b4c003c35e02529ba00c779c.tar.zst cuberite-cdaa48377846c688b4c003c35e02529ba00c779c.zip |
Diffstat (limited to 'source/Protocol/Protocol125.cpp')
-rw-r--r-- | source/Protocol/Protocol125.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp index c4c15819d..4577e0c16 100644 --- a/source/Protocol/Protocol125.cpp +++ b/source/Protocol/Protocol125.cpp @@ -747,7 +747,7 @@ void cProtocol125::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, -void cProtocol125::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleType) +void cProtocol125::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) { cCSLock Lock(m_CSPacket); WriteByte (PACKET_SPAWN_OBJECT); @@ -758,10 +758,13 @@ void cProtocol125::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 (1); - WriteShort((short)(a_Vehicle.GetSpeedX() * 400)); - WriteShort((short)(a_Vehicle.GetSpeedY() * 400)); - WriteShort((short)(a_Vehicle.GetSpeedZ() * 400)); + WriteInt (a_VehicleSubType); + if (a_VehicleSubType != 0) + { + WriteShort((short)(a_Vehicle.GetSpeedX() * 400)); + WriteShort((short)(a_Vehicle.GetSpeedY() * 400)); + WriteShort((short)(a_Vehicle.GetSpeedZ() * 400)); + } Flush(); } |