Fix a very rare light propagation bug

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.
This commit is contained in:
Dylan K. Taylor 2017-07-19 12:02:16 +01:00
parent 256527c953
commit 523a7f0999

View File

@ -158,11 +158,9 @@ abstract class LightUpdate{
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]);
}
}
}