summaryrefslogtreecommitdiffstats
path: root/source/LightingThread.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-11-16 10:40:15 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-11-16 10:40:15 +0100
commitc360d683e0aebe3f6a56257f200cafc7b6849834 (patch)
treec1345c2586259677ca9378d37162a0b90470f826 /source/LightingThread.h
parent- Added the "wait" music disc (diff)
downloadcuberite-c360d683e0aebe3f6a56257f200cafc7b6849834.tar
cuberite-c360d683e0aebe3f6a56257f200cafc7b6849834.tar.gz
cuberite-c360d683e0aebe3f6a56257f200cafc7b6849834.tar.bz2
cuberite-c360d683e0aebe3f6a56257f200cafc7b6849834.tar.lz
cuberite-c360d683e0aebe3f6a56257f200cafc7b6849834.tar.xz
cuberite-c360d683e0aebe3f6a56257f200cafc7b6849834.tar.zst
cuberite-c360d683e0aebe3f6a56257f200cafc7b6849834.zip
Diffstat (limited to 'source/LightingThread.h')
-rw-r--r--source/LightingThread.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/LightingThread.h b/source/LightingThread.h
index a19bc548e..498755025 100644
--- a/source/LightingThread.h
+++ b/source/LightingThread.h
@@ -146,7 +146,7 @@ protected:
int & a_NumSeedsOut, unsigned char * a_IsSeedOut, unsigned int * a_SeedIdxOut
);
- /// Compresses from 1-byte-per-block into 2-bytes-per-block:
+ /// Compresses from 1-block-per-byte (faster calc) into 2-blocks-per-byte (MC storage):
void CompressLight(NIBBLETYPE * a_LightArray, NIBBLETYPE * a_ChunkLight);
inline void PropagateLight(
@@ -155,6 +155,11 @@ protected:
int & a_NumSeedsOut, unsigned char * a_IsSeedOut, unsigned int * a_SeedIdxOut
)
{
+ ASSERT(a_SrcIdx >= 0);
+ ASSERT(a_SrcIdx < ARRAYCOUNT(m_SkyLight));
+ ASSERT(a_DstIdx >= 0);
+ ASSERT(a_DstIdx < ARRAYCOUNT(m_BlockTypes));
+
if (a_Light[a_SrcIdx] <= a_Light[a_DstIdx] + g_BlockSpreadLightFalloff[m_BlockTypes[a_DstIdx]])
{
// We're not offering more light than the dest block already has