forked from Mirrorlandia_minetest/minetest
Fix lighting of upright_sprite entities (#12336)
Use MeshNode materials to set the light since ReadOnlyMaterials is now false
This commit is contained in:
parent
604fb2b738
commit
a4ef62f5b2
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user