Enforce hiding nametag
authorest31 <MTest31@outlook.com>
Mon, 18 May 2015 20:41:22 +0000 (22:41 +0200)
committerest31 <MTest31@outlook.com>
Mon, 18 May 2015 21:10:48 +0000 (23:10 +0200)
Work around irrlicht bug and hide nametag if its alpha is set to 0.
Thanks @TeTpaAka for pointing out workaround.

src/content_cao.cpp

index b49c64ae85bbc9afd8fa480dfcc6e191e09ef624..d80804d4a0bae3b384521164ea4a324998d2179f 100644 (file)
@@ -1721,6 +1721,11 @@ void GenericCAO::processMessage(const std::string &data)
                        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);
                        }
                }
        }