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)