summaryrefslogtreecommitdiffstats
path: root/src/LightingThread.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-10 22:27:48 +0100
committerMattes D <github@xoft.cz>2014-12-10 22:27:48 +0100
commit563f41af65dbe48ac8fa59a045b3a38b22d00266 (patch)
tree262215f18d8d4739063c2891658ea277116fff81 /src/LightingThread.cpp
parentAdded a RemoveIf() function to cQueue (diff)
downloadcuberite-563f41af65dbe48ac8fa59a045b3a38b22d00266.tar
cuberite-563f41af65dbe48ac8fa59a045b3a38b22d00266.tar.gz
cuberite-563f41af65dbe48ac8fa59a045b3a38b22d00266.tar.bz2
cuberite-563f41af65dbe48ac8fa59a045b3a38b22d00266.tar.lz
cuberite-563f41af65dbe48ac8fa59a045b3a38b22d00266.tar.xz
cuberite-563f41af65dbe48ac8fa59a045b3a38b22d00266.tar.zst
cuberite-563f41af65dbe48ac8fa59a045b3a38b22d00266.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);