From d56c0be9bd6b5c578516d1310141e53625fa055b Mon Sep 17 00:00:00 2001 From: Onran <100285264+Onran0@users.noreply.github.com> Date: Sun, 25 Feb 2024 14:05:48 +0900 Subject: [PATCH] minor refact --- src/lighting/Lighting.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lighting/Lighting.cpp b/src/lighting/Lighting.cpp index 6433db4f..a79b066d 100644 --- a/src/lighting/Lighting.cpp +++ b/src/lighting/Lighting.cpp @@ -152,10 +152,11 @@ void Lighting::onChunkLoaded(int cx, int cz, bool expand){ void Lighting::onBlockSet(int x, int y, int z, blockid_t id){ Block* block = content->getIndices()->getBlockDef(id); + solverR->remove(x,y,z); + solverG->remove(x,y,z); + solverB->remove(x,y,z); + if (id == 0){ - solverR->remove(x,y,z); - solverG->remove(x,y,z); - solverB->remove(x,y,z); solverR->solve(); solverG->solve(); solverB->solve(); @@ -178,9 +179,6 @@ void Lighting::onBlockSet(int x, int y, int z, blockid_t id){ solverB->solve(); solverS->solve(); } else { - solverR->remove(x,y,z); - solverG->remove(x,y,z); - solverB->remove(x,y,z); if (!block->skyLightPassing){ solverS->remove(x,y,z); for (int i = y-1; i >= 0; i--){