mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
World::orderChunkPopulation() may return a pre-resolved promise
this does not indicate a failure; it indicates that the chunk has already been successfully populated. In this case, we shouldn't be putting the task back on the queue. This is skirting around the real bug, which is that requestChunkPopulation() doesn't check if the target chunk is already populated before it creates a new promise that it will be.
This commit is contained in:
parent
08636d079d
commit
2fa0a914ff
@ -2765,8 +2765,10 @@ class World implements ChunkManager{
|
||||
World::getXZ($nextChunkHash, $nextChunkX, $nextChunkZ);
|
||||
if(isset($this->chunkPopulationRequestMap[$nextChunkHash])){
|
||||
assert(!isset($this->activeChunkPopulationTasks[$nextChunkHash]), "Population for chunk $nextChunkX $nextChunkZ already running");
|
||||
$this->orderChunkPopulation($nextChunkX, $nextChunkZ, null);
|
||||
if(!isset($this->activeChunkPopulationTasks[$nextChunkHash])){
|
||||
if(
|
||||
!$this->orderChunkPopulation($nextChunkX, $nextChunkZ, null)->isResolved() &&
|
||||
!isset($this->activeChunkPopulationTasks[$nextChunkHash])
|
||||
){
|
||||
$failed[] = $nextChunkHash;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user