Player: Assume that usedChunks was cleared by the previous loop

This commit is contained in:
Dylan K. Taylor 2021-06-27 17:50:39 +01:00
parent ede4d58394
commit db28358316
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -98,6 +98,7 @@ use pocketmine\permission\PermissibleBase;
use pocketmine\permission\PermissibleDelegateTrait;
use pocketmine\Server;
use pocketmine\timings\Timings;
use pocketmine\utils\AssumptionFailedError;
use pocketmine\utils\TextFormat;
use pocketmine\world\ChunkListener;
use pocketmine\world\ChunkListenerNoOpTrait;
@ -2002,7 +2003,9 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
$this->unloadChunk($chunkX, $chunkZ);
}
}
$this->usedChunks = [];
if(count($this->usedChunks) !== 0){
throw new AssumptionFailedError("Previous loop should have cleared this array");
}
$this->loadQueue = [];
$this->removeCurrentWindow();