Possible fix for #391

This commit is contained in:
Shoghi Cervantes 2013-06-14 02:56:29 +02:00
parent 18562317c3
commit 4c9cbaf1ee
2 changed files with 7 additions and 5 deletions

View File

@ -778,17 +778,20 @@ class BlockAPI{
$time = microtime(true);
if(count($this->scheduledUpdates) > 0){
$update = $this->server->query("SELECT x,y,z,level,type FROM blockUpdates WHERE delay <= ".$time.";");
if($update !== false and $update !== true){
if($update instanceof SQLite3Result){
$upp = array();
while(($up = $update->fetchArray(SQLITE3_ASSOC)) !== false){
$index = $up["x"].".".$up["y"].".".$up["z"].".".$up["level"].".".$up["type"];
if(isset($this->scheduledUpdates[$index])){
$upp = $this->scheduledUpdates[$index];
$upp[] = array((int) $up["type"], $this->scheduledUpdates[$index]);
unset($this->scheduledUpdates[$index]);
$this->blockUpdate($upp, (int) $up["type"]);
}
}
$this->server->query("DELETE FROM blockUpdates WHERE delay <= ".$time.";");
foreach($upp as $b){
$this->blockUpdate($b[1], $b[0]);
}
}
$this->server->query("DELETE FROM blockUpdates WHERE delay <= ".$time.";");
}
}

View File

@ -81,7 +81,6 @@ class SaplingBlock extends FlowableBlock{
}else{
return BLOCK_UPDATE_RANDOM;
}
return true;
}
return false;
}