diff options
-rw-r--r-- | source/Chunk.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/Chunk.cpp b/source/Chunk.cpp index b38f5ea19..be75eae41 100644 --- a/source/Chunk.cpp +++ b/source/Chunk.cpp @@ -2789,6 +2789,7 @@ Vector3i cChunk::PositionToWorldPosition(int a_RelX, int a_RelY, int a_RelZ) NIBBLETYPE cChunk::GetTimeAlteredLight(NIBBLETYPE a_Skylight) const { a_Skylight -= m_World->GetSkyDarkness(); + // Because NIBBLETYPE is unsigned, we clamp it to 0 .. 15 by checking for values above 15 return (a_Skylight < 16)? a_Skylight : 0; } |