From a4ef62f5b215fe0f23e3e50672f1538854db4ed9 Mon Sep 17 00:00:00 2001 From: x2048 Date: Fri, 20 May 2022 22:35:03 +0200 Subject: Fix lighting of upright_sprite entities (#12336) Use MeshNode materials to set the light since ReadOnlyMaterials is now false --- src/client/content_cao.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/client') diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp index d89bb53b3..9c3e5aa05 100644 --- a/src/client/content_cao.cpp +++ b/src/client/content_cao.cpp @@ -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) -- cgit v1.2.3