diff --git a/graphics.cc b/graphics.cc index 66a6397..a4da883 100644 --- a/graphics.cc +++ b/graphics.cc @@ -204,8 +204,10 @@ void Graphics::updateClosestLights() { std::sort(closestLights.begin(), closestLights.end(), [this](Light a, Light b) {return compareLightDistances(a, b); }); - closestLights = std::vector(&closestLights[0], - &closestLights[31]); + if (level->getLights()->size() > 32) { + closestLights = std::vector(&closestLights[0], + &closestLights[31]); + } } void Graphics::updateShaderLights() {