From d113b58b5a82e7a58b9322f384de74b663460a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Wed, 2 Feb 2022 19:41:21 +0100 Subject: [PATCH] Graphics/RenderSystem: Fix light removal --- src/Nazara/Graphics/Systems/RenderSystem.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Nazara/Graphics/Systems/RenderSystem.cpp b/src/Nazara/Graphics/Systems/RenderSystem.cpp index 47adc692e..a59e19558 100644 --- a/src/Nazara/Graphics/Systems/RenderSystem.cpp +++ b/src/Nazara/Graphics/Systems/RenderSystem.cpp @@ -199,10 +199,9 @@ namespace Nz m_newlyHiddenLightEntities.erase(entity); m_newlyVisibleLightEntities.erase(entity); - GraphicsComponent& entityGfx = registry.get(entity); - const WorldInstancePtr& worldInstance = entityGfx.GetWorldInstance(); - for (const auto& renderableEntry : entityGfx.GetRenderables()) - m_pipeline->UnregisterInstancedDrawable(worldInstance, renderableEntry.renderable.get()); + LightComponent& entityLight = registry.get(entity); + for (const auto& lightEntry : entityLight.GetLights()) + m_pipeline->UnregisterLight(lightEntry.light.get()); } void RenderSystem::OnNodeDestroy(entt::registry& registry, entt::entity entity)