Skip to content

Commit 9facb40

Browse files
committed
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.
1 parent 2853b40 commit 9facb40

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

src/content_cao.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,17 +1716,15 @@ void GenericCAO::processMessage(const std::string &data)
17161716
m_armor_groups[name] = rating;
17171717
}
17181718
} else if (cmd == GENERIC_CMD_UPDATE_NAMETAG_ATTRIBUTES) {
1719-
u8 version = readU8(is); // forward compatibility
1720-
if (version == 1) {
1721-
m_nametag_color = readARGB8(is);
1722-
if (m_textnode != NULL) {
1723-
m_textnode->setTextColor(m_nametag_color);
1724-
1725-
// Enforce hiding nametag,
1726-
// because if freetype is enabled, a grey
1727-
// shadow can remain.
1728-
m_textnode->setVisible(m_nametag_color.getAlpha() > 0);
1729-
}
1719+
readU8(is); // version
1720+
m_nametag_color = readARGB8(is);
1721+
if (m_textnode != NULL) {
1722+
m_textnode->setTextColor(m_nametag_color);
1723+
1724+
// Enforce hiding nametag,
1725+
// because if freetype is enabled, a grey
1726+
// shadow can remain.
1727+
m_textnode->setVisible(m_nametag_color.getAlpha() > 0);
17301728
}
17311729
}
17321730
}

0 commit comments

Comments
 (0)