diff --git a/src/pmf/PMFLevel.php b/src/pmf/PMFLevel.php index f4babf92e..20d50e7ff 100644 --- a/src/pmf/PMFLevel.php +++ b/src/pmf/PMFLevel.php @@ -228,15 +228,11 @@ class PMFLevel extends PMF{ if(!file_exists($path)){ if($this->generateChunk($X, $Z) === false){ return false; - }else{ + }elseif($this->isGenerating === 0){ $this->populateChunk($X, $Z); return true; } } - - if($this->isGenerating === 0 and !$this->isPopulated($X, $Z)){ - $this->populateChunk($X, $Z); - } $chunk = @gzopen($path, "rb"); if($chunk === false){ @@ -261,6 +257,9 @@ class PMFLevel extends PMF{ } } @gzclose($chunk); + if($this->isGenerating === 0 and !$this->isPopulated($X, $Z)){ + $this->populateChunk($X, $Z); + } return true; }