From f3032a637c53f3c98fbbed1d3b691898aabe1687 Mon Sep 17 00:00:00 2001 From: Danila Shutov Date: Mon, 23 Mar 2020 23:57:44 +0300 Subject: [PATCH] Fix incorrect light updates for wielditem and item visuals (#9540) An alternative to #9537 --- src/client/content_cao.cpp | 8 +++++--- 1 file 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); } -- 2.25.1