Skip to content

Commit

Permalink
Fix lighting of upright_sprite entities (minetest#12336)
Browse files Browse the repository at this point in the history
Use MeshNode materials to set the light since ReadOnlyMaterials is now false
  • Loading branch information
x2048 committed May 20, 2022
1 parent 604fb2b commit a4ef62f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/client/content_cao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -905,12 +905,8 @@ void GenericCAO::setNodeLight(const video::SColor &light_color)
if (m_prop.visual == "upright_sprite") {
if (!m_meshnode)
return;

scene::IMesh *mesh = m_meshnode->getMesh();
for (u32 i = 0; i < mesh->getMeshBufferCount(); ++i) {
scene::IMeshBuffer *buf = mesh->getMeshBuffer(i);
buf->getMaterial().EmissiveColor = light_color;
}
for (u32 i = 0; i < m_meshnode->getMaterialCount(); ++i)
m_meshnode->getMaterial(i).EmissiveColor = light_color;
} else {
scene::ISceneNode *node = getSceneNode();
if (!node)
Expand Down

0 comments on commit a4ef62f

Please sign in to comment.