summaryrefslogtreecommitdiffstats
path: root/src/LightingThread.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-11 17:06:18 +0100
committerMattes D <github@xoft.cz>2014-12-11 17:06:18 +0100
commit781b3303a5aeb1ac572d83452186ed3777040487 (patch)
tree43cec18a07f201e8c94e9ac318f4635b0d4053bb /src/LightingThread.cpp
parentCosmetic touchups. (diff)
parentAdded a cWorld:PrepareChunk function. (diff)
downloadcuberite-781b3303a5aeb1ac572d83452186ed3777040487.tar
cuberite-781b3303a5aeb1ac572d83452186ed3777040487.tar.gz
cuberite-781b3303a5aeb1ac572d83452186ed3777040487.tar.bz2
cuberite-781b3303a5aeb1ac572d83452186ed3777040487.tar.lz
cuberite-781b3303a5aeb1ac572d83452186ed3777040487.tar.xz
cuberite-781b3303a5aeb1ac572d83452186ed3777040487.tar.zst
cuberite-781b3303a5aeb1ac572d83452186ed3777040487.zip
Diffstat (limited to 'src/LightingThread.cpp')
-rw-r--r--src/LightingThread.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp
index ae5e746e7..01ba24105 100644
--- a/src/LightingThread.cpp
+++ b/src/LightingThread.cpp
@@ -236,6 +236,16 @@ void cLightingThread::Execute(void)
void cLightingThread::LightChunk(cLightingChunkStay & a_Item)
{
+ // If the chunk is already lit, skip it:
+ if (m_World->IsChunkLighted(a_Item.m_ChunkX, a_Item.m_ChunkZ))
+ {
+ if (a_Item.m_CallbackAfter != nullptr)
+ {
+ a_Item.m_CallbackAfter->Call(a_Item.m_ChunkX, a_Item.m_ChunkZ);
+ }
+ return;
+ }
+
cChunkDef::BlockNibbles BlockLight, SkyLight;
ReadChunks(a_Item.m_ChunkX, a_Item.m_ChunkZ);