Prevent attempting to calculate lighting changes below y = 0 (#201)

This commit is contained in:
Tim (robske_110) 2016-12-23 21:16:28 +01:00 committed by Dylan K. Taylor
parent a63020d6e5
commit 6d2a57f83a

View File

@ -1319,6 +1319,7 @@ class Level implements ChunkManager, Metadatable{
}
private function computeRemoveBlockLight(int $x, int $y, int $z, int $currentLight, \SplQueue $queue, \SplQueue $spreadQueue, array &$visited, array &$spreadVisited){
if($y < 0) return;
$current = $this->getBlockLightAt($x, $y, $z);
if($current !== 0 and $current < $currentLight){
@ -1339,6 +1340,7 @@ class Level implements ChunkManager, Metadatable{
}
private function computeSpreadBlockLight(int $x, int $y, int $z, int $currentLight, \SplQueue $queue, array &$visited){
if($y < 0) return;
$current = $this->getBlockLightAt($x, $y, $z);
if($current < $currentLight){