SubChunk: fixed light array GC since native LightArray introduction

since this went native, there was no support for copy-on-write, so this was only lazy-inited, but never cleaned if the array remained empty.
This commit is contained in:
Dylan K. Taylor 2021-09-07 22:54:54 +01:00
parent 11d2e1ef08
commit bc6e73e81d
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -145,11 +145,11 @@ class SubChunk{
} }
$this->blockLayers = array_values($this->blockLayers); $this->blockLayers = array_values($this->blockLayers);
if($this->skyLight !== null){ if($this->skyLight !== null && $this->skyLight->isUniform(0)){
$this->skyLight->collectGarbage(); $this->skyLight = null;
} }
if($this->blockLight !== null){ if($this->blockLight !== null && $this->blockLight->isUniform(0)){
$this->blockLight->collectGarbage(); $this->blockLight = null;
} }
} }