Fixed RegionLoader corrupting location table when too-large chunks are discovered

this was making the location table point to an offset that did not yet exist, which caused the region header consistency check to discard the region as corrupted the next time it was loaded.
This commit is contained in:
Dylan K. Taylor 2019-03-05 12:09:27 +00:00
parent 55994e08db
commit d25c84acff

View File

@ -140,8 +140,6 @@ class RegionLoader{
if($length <= 0 or $length > self::MAX_SECTOR_LENGTH){ //Not yet generated / corrupted
if($length >= self::MAX_SECTOR_LENGTH){
$this->locationTable[$index][0] = ++$this->lastSector;
$this->locationTable[$index][1] = 1;
throw new CorruptedChunkException("Corrupted chunk header detected (sector count $length larger than max " . self::MAX_SECTOR_LENGTH . ")");
}
return null;