Fixed updating of lights.

This commit is contained in:
Fabian Klemp 2015-02-13 17:35:56 +01:00
parent 1492a312ed
commit df230ea677

View File

@ -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<Light>(&closestLights[0],
&closestLights[31]);
if (level->getLights()->size() > 32) {
closestLights = std::vector<Light>(&closestLights[0],
&closestLights[31]);
}
}
void Graphics::updateShaderLights() {