Skip to content

Commit

Permalink
Fix a very rare light propagation bug
Browse files Browse the repository at this point in the history
This could occur when light sources were placed near each other and one of them is removed, the other's light would not be propagated far enough because the node wasn't queued for updating although it was marked as if it was.
  • Loading branch information
dktapps committed Nov 27, 2017
1 parent 256527c commit 523a7f0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/pocketmine/level/light/LightUpdate.php
Expand Up @@ -158,11 +158,9 @@ protected function computeSpreadLight(int $x, int $y, int $z, int $newAdjacentLe
if($current < $potentialLight){
$this->setLight($x, $y, $z, $potentialLight);

if(!isset($this->spreadVisited[$index = Level::blockHash($x, $y, $z)])){
if(!isset($this->spreadVisited[$index = Level::blockHash($x, $y, $z)]) and $potentialLight > 1){
$this->spreadVisited[$index] = true;
if($potentialLight > 1){
$this->spreadQueue->enqueue([$x, $y, $z]);
}
$this->spreadQueue->enqueue([$x, $y, $z]);
}
}
}
Expand Down

0 comments on commit 523a7f0

Please sign in to comment.