mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
RegionLoader: check for zero sector count when loading location table
implementations shouldn't be writing location entries that have an offset but zero sectors, but just in case they do, we need to be aware of it.
This commit is contained in:
parent
22f25dfbdb
commit
b92a2ded8a
@ -272,9 +272,10 @@ class RegionLoader{
|
||||
for($i = 0; $i < 1024; ++$i){
|
||||
$index = $data[$i + 1];
|
||||
$offset = $index >> 8;
|
||||
$sectorCount = $index & 0xff;
|
||||
$timestamp = $data[$i + 1025];
|
||||
|
||||
if($offset === 0){
|
||||
if($offset === 0 or $sectorCount === 0){
|
||||
$this->locationTable[$i] = null;
|
||||
}else{
|
||||
$this->bumpNextFreeSector($this->locationTable[$i] = new RegionLocationTableEntry($offset, $index & 0xff, $timestamp));
|
||||
|
Loading…
x
Reference in New Issue
Block a user