diff --git a/Runtime/Graphics/CBooRenderer.cpp b/Runtime/Graphics/CBooRenderer.cpp index 58811941b..8b29fdf5c 100644 --- a/Runtime/Graphics/CBooRenderer.cpp +++ b/Runtime/Graphics/CBooRenderer.cpp @@ -223,8 +223,9 @@ CBooRenderer::CAreaListItem::CAreaListItem(const std::vector thisLights; - thisLights.reserve(4); + thisLights.reserve(lightCount); if (!x300_dynamicLights.empty()) { u32 lightOctreeWordCount = 0; @@ -234,10 +235,10 @@ void CBooRenderer::ActivateLightsForModel(CAreaListItem* item, CBooModel& model) lightOctreeWords = item->x1c_lightOctreeWords.data(); } - std::array lightRads{-1.f, -1.f, -1.f, -1.f}; - std::array lightRefs{}; + std::array lightRads{-1.f, -1.f, -1.f, -1.f}; + std::array lightRefs{}; auto it = x300_dynamicLights.begin(); - for (size_t i = 0; i < thisLights.capacity() && it != x300_dynamicLights.end(); + for (size_t i = 0; i < lightCount && it != x300_dynamicLights.end(); ++it, lightOctreeWords += lightOctreeWordCount) { CLight& refLight = *it; if (lightOctreeWords != nullptr && !TestBit(lightOctreeWords, model.x44_areaInstanceIdx)) {