Skip to content

Commit

Permalink
Fix incorrect light updates for wielditem and item visuals (#9540)
Browse files Browse the repository at this point in the history
An alternative to #9537
  • Loading branch information
FunkyDck committed Mar 23, 2020
1 parent 625b100 commit f3032a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/client/content_cao.cpp
Expand Up @@ -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)
Expand All @@ -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);
}
Expand Down

0 comments on commit f3032a6

Please sign in to comment.