summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-05-18 21:01:57 +0200
committerest31 <MTest31@outlook.com>2015-05-18 21:11:41 +0200
commit23984ef7f0c13f6ae011587ba0488b9ea1bb64f8 (patch)
tree5c40ae70c54e237eab0d55b2d55b0d61b70dfeb9 /src
parent20aa78cffb6594ff8fdea4291f18d1a8bd252529 (diff)
downloadminetest-23984ef7f0c13f6ae011587ba0488b9ea1bb64f8.tar.gz
minetest-23984ef7f0c13f6ae011587ba0488b9ea1bb64f8.tar.bz2
minetest-23984ef7f0c13f6ae011587ba0488b9ea1bb64f8.zip
Make nametags white again
Commit 11a96e4901ce54c4646e47866f7a66cd9034c16b 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).
Diffstat (limited to 'src')
-rw-r--r--src/content_cao.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index bb2fb06a7..b49c64ae8 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -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) {
+ m_nametag_color = readARGB8(is);
+ if (m_textnode != NULL) {
+ m_textnode->setTextColor(m_nametag_color);
+ }
}
}
}