summaryrefslogtreecommitdiffstats
path: root/source/LightingThread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/LightingThread.cpp')
-rw-r--r--source/LightingThread.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/LightingThread.cpp b/source/LightingThread.cpp
index 258fd7dd4..d7e60e458 100644
--- a/source/LightingThread.cpp
+++ b/source/LightingThread.cpp
@@ -407,9 +407,12 @@ void cLightingThread::PrepareSkyLight(void)
}
// Add Current as a seed:
- int CurrentIdx = idx + Current * BlocksPerYLayer;
- m_IsSeed1[CurrentIdx] = true;
- m_SeedIdx1[m_NumSeeds++] = CurrentIdx;
+ if (Current < cChunkDef::Height)
+ {
+ int CurrentIdx = idx + Current * BlocksPerYLayer;
+ m_IsSeed1[CurrentIdx] = true;
+ m_SeedIdx1[m_NumSeeds++] = CurrentIdx;
+ }
// Add seed from Current up to the highest neighbor:
for (int y = Current + 1, Index = idx + y * BlocksPerYLayer; y < MaxNeighbor; y++, Index += BlocksPerYLayer)