From 95fb90eaa642b76915a117495b472d7f7e141cde Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 6 Apr 2014 22:28:41 +0200 Subject: Fixed 1.6.4 client crash on composite chat messages. --- src/Protocol/Protocol16x.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Protocol/Protocol16x.cpp') diff --git a/src/Protocol/Protocol16x.cpp b/src/Protocol/Protocol16x.cpp index bf7d9a0b1..3da23a1dc 100644 --- a/src/Protocol/Protocol16x.cpp +++ b/src/Protocol/Protocol16x.cpp @@ -18,6 +18,7 @@ Implements the 1.6.x protocol classes: #include "../Entities/Entity.h" #include "../Entities/Player.h" #include "../UI/Window.h" +#include "../CompositeChat.h" @@ -89,6 +90,18 @@ void cProtocol161::SendChat(const AString & a_Message) +void cProtocol161::SendChat(const cCompositeChat & a_Message) +{ + // This protocol version doesn't support composite messages to the full + // Just extract each part's text and use it: + + super::SendChat(Printf("{\"text\":\"%s\"}", EscapeString(a_Message.ExtractText()).c_str())); +} + + + + + void cProtocol161::SendEditSign(int a_BlockX, int a_BlockY, int a_BlockZ) { cCSLock Lock(m_CSPacket); -- cgit v1.2.3