RegionLoader: fixed regions ballooning when writing chunks to the end of file

we already have a region growth problem due to the lack of garbage collection, but this bug was making it worse. If the region already contained 1024 allocated chunks, 4MB of file space would get wasted before the next chunk would be appended to the file.
This commit is contained in:
Dylan K. Taylor 2020-06-14 23:40:33 +01:00
parent e05bee5ffb
commit 745be19a56

View File

@ -366,7 +366,7 @@ class RegionLoader{
}
private function bumpNextFreeSector(RegionLocationTableEntry $entry) : void{
$this->nextSector = max($this->nextSector, $entry->getLastSector()) + 1;
$this->nextSector = max($this->nextSector, $entry->getLastSector() + 1);
}
public function getX() : int{