Don't ignore nametag attribute change message for newer versions
authorest31 <MTest31@outlook.com>
Thu, 21 May 2015 16:58:39 +0000 (18:58 +0200)
committerest31 <MTest31@outlook.com>
Thu, 21 May 2015 17:01:46 +0000 (19:01 +0200)
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

index d80804d4a0bae3b384521164ea4a324998d2179f..9ee81e63f9dd01df5687d742d0fd1e822b5bdf10 100644 (file)
@@ -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);
-
-                               // Enforce hiding nametag,
-                               // because if freetype is enabled, a grey
-                               // shadow can remain.
-                               m_textnode->setVisible(m_nametag_color.getAlpha() > 0);
-                       }
+               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);
                }
        }
 }