diff options
author | Pokechu22 <Pokechu22@users.noreply.github.com> | 2016-05-14 21:12:42 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2016-05-14 21:12:42 +0200 |
commit | a4f327118b06ced1cd4510b7d20d34da83aa78a3 (patch) | |
tree | d6dbd41cfbec99f2598fb51907b86d9cbe0e8a05 /src/Protocol/Protocol18x.cpp | |
parent | Fixed death on teleportation or leaving Minecart (#3181) (diff) | |
download | cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.gz cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.bz2 cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.lz cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.xz cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.zst cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index eab6c4721..ae9571f03 100644 --- a/src/Protocol/Protocol18x.cpp +++ b/src/Protocol/Protocol18x.cpp @@ -171,13 +171,13 @@ void cProtocol180::DataReceived(const char * a_Data, size_t a_Size) -void cProtocol180::SendAttachEntity(const cEntity & a_Entity, const cEntity * a_Vehicle) +void cProtocol180::SendAttachEntity(const cEntity & a_Entity, const cEntity & a_Vehicle) { ASSERT(m_State == 3); // In game mode? cPacketizer Pkt(*this, 0x1b); // Attach Entity packet Pkt.WriteBEUInt32(a_Entity.GetUniqueID()); - Pkt.WriteBEUInt32((a_Vehicle != nullptr) ? a_Vehicle->GetUniqueID() : 0); + Pkt.WriteBEUInt32(a_Vehicle.GetUniqueID()); Pkt.WriteBool(false); } @@ -317,6 +317,20 @@ void cProtocol180::SendDestroyEntity(const cEntity & a_Entity) +void cProtocol180::SendDetachEntity(const cEntity & a_Entity, const cEntity & a_PreviousVehicle) +{ + ASSERT(m_State == 3); // In game mode? + + cPacketizer Pkt(*this, 0x1b); // Attach Entity packet + Pkt.WriteBEUInt32(a_Entity.GetUniqueID()); + Pkt.WriteBEUInt32(0); + Pkt.WriteBool(false); +} + + + + + void cProtocol180::SendDisconnect(const AString & a_Reason) { switch (m_State) |