Skip to content

Commit

Permalink
[ChunkLightmap] Removed useless lines.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Unarelith committed May 22, 2021
1 parent e15dbcc commit ebe9887
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions source/common/world/ChunkLightmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit ebe9887

Please sign in to comment.