]> git.lizzy.rs Git - minetest.git/commitdiff
Fix enforcing of nametag hiding
authorest31 <MTest31@outlook.com>
Thu, 15 Oct 2015 21:46:03 +0000 (23:46 +0200)
committerest31 <MTest31@outlook.com>
Thu, 15 Oct 2015 21:46:03 +0000 (23:46 +0200)
Commit

d2ca662569427d36642660314668e416bf68f3c8 "Enforce hiding nametag"

didn't fix the issue for "client" instances, where the nametag update
was received before the object was added to the scene. This resulted
in the grey shadow on the nametag that commit tried to fix.

Thanks to @neoascetic for pointing out that there still is a shadow.

src/content_cao.cpp

index b3f90aa9c618ffc9d6b8b59c7ec3ab17d9616c3e..e864063a41784d6f92dfc6f060928db5cfef5c69 100644 (file)
@@ -975,6 +975,11 @@ void GenericCAO::addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
                                wname.c_str(), m_nametag_color, node);
                m_textnode->grab();
                m_textnode->setPosition(v3f(0, BS*1.1, 0));
+
+               // Enforce hiding nametag,
+               // because if freetype is enabled, a grey
+               // shadow can remain.
+               m_textnode->setVisible(m_nametag_color.getAlpha() > 0);
        }
 
        updateNodePos();