mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
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