Fixed PMFLevel infinite loop

This commit is contained in:
Shoghi Cervantes 2014-02-14 14:21:28 +01:00
parent 47893ed765
commit cbe07a1fa0

View File

@ -228,15 +228,11 @@ class PMFLevel extends PMF{
if(!file_exists($path)){ if(!file_exists($path)){
if($this->generateChunk($X, $Z) === false){ if($this->generateChunk($X, $Z) === false){
return false; return false;
}else{ }elseif($this->isGenerating === 0){
$this->populateChunk($X, $Z); $this->populateChunk($X, $Z);
return true; return true;
} }
} }
if($this->isGenerating === 0 and !$this->isPopulated($X, $Z)){
$this->populateChunk($X, $Z);
}
$chunk = @gzopen($path, "rb"); $chunk = @gzopen($path, "rb");
if($chunk === false){ if($chunk === false){
@ -261,6 +257,9 @@ class PMFLevel extends PMF{
} }
} }
@gzclose($chunk); @gzclose($chunk);
if($this->isGenerating === 0 and !$this->isPopulated($X, $Z)){
$this->populateChunk($X, $Z);
}
return true; return true;
} }