summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
authorPokechu22 <Pokechu22@users.noreply.github.com>2016-05-14 21:12:42 +0200
committerAlexander Harkness <me@bearbin.net>2016-05-14 21:12:42 +0200
commita4f327118b06ced1cd4510b7d20d34da83aa78a3 (patch)
treed6dbd41cfbec99f2598fb51907b86d9cbe0e8a05 /src/Protocol/Protocol17x.cpp
parentFixed death on teleportation or leaving Minecart (#3181) (diff)
downloadcuberite-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/Protocol17x.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 69b87e4d1..843675333 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -160,13 +160,13 @@ void cProtocol172::DataReceived(const char * a_Data, size_t a_Size)
-void cProtocol172::SendAttachEntity(const cEntity & a_Entity, const cEntity * a_Vehicle)
+void cProtocol172::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);
}
@@ -324,6 +324,20 @@ void cProtocol172::SendDestroyEntity(const cEntity & a_Entity)
+void cProtocol172::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 cProtocol172::SendDisconnect(const AString & a_Reason)
{
switch (m_State)