diff options
author | Danila Shutov <dcbrwn2@gmail.com> | 2020-03-23 23:57:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-23 21:57:44 +0100 |
commit | f3032a637c53f3c98fbbed1d3b691898aabe1687 (patch) | |
tree | 981ea8048585d44cc00ef06a121bbc06b6ebf90c /src/client | |
parent | 625b1005939e76d6a5b2d241635be3b8a89eb128 (diff) | |
download | minetest-f3032a637c53f3c98fbbed1d3b691898aabe1687.tar.gz minetest-f3032a637c53f3c98fbbed1d3b691898aabe1687.tar.bz2 minetest-f3032a637c53f3c98fbbed1d3b691898aabe1687.zip |
Fix incorrect light updates for wielditem and item visuals (#9540)
An alternative to #9537
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/content_cao.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp index 49463c3d3..30b1b8212 100644 --- a/src/client/content_cao.cpp +++ b/src/client/content_cao.cpp @@ -826,7 +826,11 @@ void GenericCAO::setNodeLight(u8 light) { video::SColor color(255, light, light, light); - if (m_enable_shaders) { + if (m_prop.visual == "wielditem" || m_prop.visual == "item") { + // Since these types of visuals are using their own shader + // they should be handled separately + m_wield_meshnode->setColor(color); + } else if (m_enable_shaders) { scene::ISceneNode *node = getSceneNode(); if (node == nullptr) @@ -850,8 +854,6 @@ void GenericCAO::setNodeLight(u8 light) setMeshColor(m_meshnode->getMesh(), color); } else if (m_animated_meshnode) { setAnimatedMeshColor(m_animated_meshnode, color); - } else if (m_wield_meshnode) { - m_wield_meshnode->setColor(color); } else if (m_spritenode) { m_spritenode->setColor(color); } |