From 009e8b1058ee97b8c31e0635cec31219ec0f5972 Mon Sep 17 00:00:00 2001 From: est31 Date: Thu, 21 May 2015 18:58:39 +0200 Subject: [PATCH] Don't ignore nametag attribute change message for newer versions This allows newer versions to add additional information that isn't read by us, but still in a backwards compatible manner. --- src/content_cao.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/content_cao.cpp b/src/content_cao.cpp index d80804d4a..9ee81e63f 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -1716,17 +1716,15 @@ void GenericCAO::processMessage(const std::string &data) m_armor_groups[name] = rating; } } else if (cmd == GENERIC_CMD_UPDATE_NAMETAG_ATTRIBUTES) { - u8 version = readU8(is); // forward compatibility - if (version == 1) { - m_nametag_color = readARGB8(is); - if (m_textnode != NULL) { - m_textnode->setTextColor(m_nametag_color); + readU8(is); // version + m_nametag_color = readARGB8(is); + if (m_textnode != NULL) { + m_textnode->setTextColor(m_nametag_color); - // Enforce hiding nametag, - // because if freetype is enabled, a grey - // shadow can remain. - m_textnode->setVisible(m_nametag_color.getAlpha() > 0); - } + // Enforce hiding nametag, + // because if freetype is enabled, a grey + // shadow can remain. + m_textnode->setVisible(m_nametag_color.getAlpha() > 0); } } }