mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-26 21:29:55 +00:00
RegionLoader: backport 62185d476bc2463be6de20604cd4ef83733dcce2
This commit is contained in:
parent
0aed7f86f5
commit
93cb9390e0
@ -31,7 +31,7 @@ use function array_fill;
|
||||
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;
|
||||
@ -283,7 +283,7 @@ class RegionLoader{
|
||||
$fileOffset = $offset << 12;
|
||||
|
||||
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");
|
||||
}elseif(isset($usedOffsets[$offset])){
|
||||
self::getChunkCoords($usedOffsets[$offset], $existingX, $existingZ);
|
||||
|
Loading…
x
Reference in New Issue
Block a user