Skip to content

Commit f3032a6

Browse files
authoredMar 23, 2020
Fix incorrect light updates for wielditem and item visuals (#9540)
An alternative to #9537
1 parent 625b100 commit f3032a6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/client/content_cao.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,11 @@ void GenericCAO::setNodeLight(u8 light)
826826
{
827827
video::SColor color(255, light, light, light);
828828

829-
if (m_enable_shaders) {
829+
if (m_prop.visual == "wielditem" || m_prop.visual == "item") {
830+
// Since these types of visuals are using their own shader
831+
// they should be handled separately
832+
m_wield_meshnode->setColor(color);
833+
} else if (m_enable_shaders) {
830834
scene::ISceneNode *node = getSceneNode();
831835

832836
if (node == nullptr)
@@ -850,8 +854,6 @@ void GenericCAO::setNodeLight(u8 light)
850854
setMeshColor(m_meshnode->getMesh(), color);
851855
} else if (m_animated_meshnode) {
852856
setAnimatedMeshColor(m_animated_meshnode, color);
853-
} else if (m_wield_meshnode) {
854-
m_wield_meshnode->setColor(color);
855857
} else if (m_spritenode) {
856858
m_spritenode->setColor(color);
857859
}

0 commit comments

Comments
 (0)
Please sign in to comment.