From df230ea6776ddca5b701ffe7556a9446c617f7ec Mon Sep 17 00:00:00 2001 From: Fabian Klemp Date: Fri, 13 Feb 2015 17:35:56 +0100 Subject: [PATCH] Fixed updating of lights. --- graphics.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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() {