[ChunkLightmap] Small optimization.

This commit is contained in:
Quentin Bazin 2020-01-02 16:17:27 +09:00
parent d45f7d88aa
commit 8e0774bb3a

View File

@ -160,6 +160,8 @@ void ChunkLightmap::updateSunlight() {
/* || !Registry::getInstance().getBlock(block).isOpaque() */) { // FIXME
if (sunlightLevel == 15 && surroundingNode.y == node.y - 1)
setSunlight(surroundingNode.x, surroundingNode.y, surroundingNode.z, sunlightLevel);
else if (sunlightLevel == 15 && surroundingNode.y == node.y + 1)
continue;
else
setSunlight(surroundingNode.x, surroundingNode.y, surroundingNode.z, sunlightLevel - 1);