From 9adab5f9bfd2057cf2f08f3f56e807ffbd75f96a Mon Sep 17 00:00:00 2001 From: Ahmed Samy Date: Fri, 27 Dec 2013 12:59:50 +0200 Subject: [PATCH] Item serialization: Write description & text --- src/client/item.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/client/item.cpp b/src/client/item.cpp index 2c984f10..672ff933 100644 --- a/src/client/item.cpp +++ b/src/client/item.cpp @@ -221,6 +221,17 @@ void Item::serializeItem(const OutputBinaryTreePtr& out) out->addU16(uid); } + std::string text = getText(); + if(g_things.getItemType(m_serverId)->isWritable() && !text.empty()) { + out->addU8(ATTR_TEXT); + out->addString(text); + } + std::string desc = getDescription(); + if(!desc.empty()) { + out->addU8(ATTR_DESC); + out->addString(desc); + } + out->endNode(); for(auto i : m_containerItems) i->serializeItem(out);