From ebe9887ecfdfb65b2ac0ebe6bfef288e5348adde Mon Sep 17 00:00:00 2001 From: Quentin Bazin Date: Sat, 22 May 2021 16:06:19 +0200 Subject: [PATCH] [ChunkLightmap] Removed useless lines. It doesn't seem the engine needs to revert addSunlight anymore, but it may be subject to change, so I removed it as long as I don't see another problem. --- source/common/world/ChunkLightmap.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/source/common/world/ChunkLightmap.cpp b/source/common/world/ChunkLightmap.cpp index e9ee741c..d1583196 100644 --- a/source/common/world/ChunkLightmap.cpp +++ b/source/common/world/ChunkLightmap.cpp @@ -129,13 +129,8 @@ void ChunkLightmap::updateTorchlight() { // If this block is opaque, don't propagate the light const BlockState *blockState = m_chunk->getBlockState(node.x, node.y, node.z); - if (blockState && blockState->isOpaque() && !blockState->isLightSource()) { - // FIXME: This only reverts an addTorchlight that added light in a non-generated chunk - // I should avoid setting the torchlight rather than reverting it - setTorchlight(node.x, node.y, node.z, 0); - + if (blockState && blockState->isOpaque() && !blockState->isLightSource()) continue; - } gk::Vector3i surroundingNodes[6] = { {node.x - 1, node.y, node.z}, @@ -191,13 +186,8 @@ void ChunkLightmap::updateSunlight() { // If this block is opaque, don't propagate the light const BlockState *blockState = m_chunk->getBlockState(node.x, node.y, node.z); - if (blockState && blockState->isOpaque()) { - // FIXME: This only reverts an addSunlight that added light in a non-generated chunk - // I should avoid setting the sunlight rather than reverting it - setSunlight(node.x, node.y, node.z, 0); - + if (blockState && blockState->isOpaque()) continue; - } gk::Vector3i surroundingNodes[6] = { {node.x - 1, node.y, node.z},