Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make nametags white again
Commit 11a96e4
commented out version parsing, resulting in the version byte being parsed as part of the color,
making nametags dark grey.
Re-introduces version parsing and ignores the packet if the version is more recent than ours,
fixing the unused variable warning (should have been done anyway).
  • Loading branch information
est31 committed May 18, 2015
1 parent 20aa78c commit 23984ef
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/content_cao.cpp
Expand Up @@ -1716,10 +1716,12 @@ 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
m_nametag_color = readARGB8(is);
if (m_textnode != NULL) {
m_textnode->setTextColor(m_nametag_color);
u8 version = readU8(is); // forward compatibility
if (version == 1) {

This comment has been minimized.

Copy link
@TeTpaAka

TeTpaAka May 21, 2015

Contributor

It should be probably:
if (version >= 1) {
Currently, if the version increases, older clients will simply ignore the packet, although newer versions will probably only add something at the end.

This comment has been minimized.

Copy link
@est31

est31 May 21, 2015

Author Contributor

Sounds reasonable. I'll remove the if completely then.

m_nametag_color = readARGB8(is);
if (m_textnode != NULL) {
m_textnode->setTextColor(m_nametag_color);
}
}
}
}
Expand Down

0 comments on commit 23984ef

Please sign in to comment.