diff --git a/src/World.cpp b/src/World.cpp index 5f4cf0f9..9f7ecef5 100755 --- a/src/World.cpp +++ b/src/World.cpp @@ -945,7 +945,7 @@ void World::renderSky(const std::shared_ptr& renderProgram, con void World::renderLight(unsigned int lightIndex, unsigned int renderLayer, const std::shared_ptr &renderProgram, const std::vector &tags) const { renderProgram->setUniform("renderLightIndex", (int) lightIndex); renderProgram->setUniform("renderLightLayer", (int) renderLayer); - Light* selectedLight = lights[lightIndex]; + Light* selectedLight = activeLights[lightIndex]; Camera* lightCamera = selectedLight->getCameras()[renderLayer]; std::unordered_map, RenderList, VisibilityRequest::uint64_vector_hasher>* cullingResult = cullingResults.at(lightCamera); for (const auto& iterator:*cullingResult) { diff --git a/src/World.h b/src/World.h index 7976cd42..f3da9b6e 100644 --- a/src/World.h +++ b/src/World.h @@ -400,7 +400,7 @@ class World { void createNodeGraph(); - std::vector getLightIndexes(Light::LightTypes lightType) { + std::vector getLightIndexes(Light::LightTypes lightType) const { std::vector lights; for (unsigned int i = 0; i < activeLights.size(); ++i) { if(activeLights[i]->getLightType() != lightType) {