RegionLoader: Fixed performance issue converting huge worlds

I was big nub when i wrote this code.
This commit is contained in:
Dylan K. Taylor 2019-03-14 15:22:44 +00:00
parent 1e0f1e5b1a
commit 62185d476b

View File

@ -29,7 +29,7 @@ use pocketmine\utils\Binary;
use function ceil;
use function chr;
use function fclose;
use function fgetc;
use function feof;
use function file_exists;
use function filesize;
use function fopen;
@ -301,7 +301,7 @@ class RegionLoader{
//TODO: more validity checks
fseek($this->filePointer, $fileOffset);
if(fgetc($this->filePointer) === false){ //Try and read from the location
if(feof($this->filePointer)){
throw new CorruptedRegionException("Region file location offset x=$x,z=$z points to invalid file location $fileOffset");
}
if(isset($usedOffsets[$offset])){