correction level fix by Armando

correction level if the building was destroyed or attacked by catapults or billowing or demolished while the level of the building was upgrade
This commit is contained in:
armando1980
2014-01-26 12:17:21 -05:00
parent 59baabd1e5
commit 64d8f15dbd
+5
View File
@@ -642,7 +642,12 @@ class Automation {
$q = "SELECT * FROM ".TB_PREFIX."bdata where timestamp < $time and master = 0";
$array = $database->query_return($q);
foreach($array as $indi) {
$level = $database->getFieldLevel($indi['wid'],$indi['field']);
if (($level+1) == $indi['level']){
$q = "UPDATE ".TB_PREFIX."fdata set f".$indi['field']." = ".$indi['level'].", f".$indi['field']."t = ".$indi['type']." where vref = ".$indi['wid'];
}else{ $indi['level']=($level+1);
$q = "UPDATE ".TB_PREFIX."fdata set f".$indi['field']." = ".$indi['level'].", f".$indi['field']."t = ".$indi['type']." where vref = ".$indi['wid'];
}
if($database->query($q)) {
$level = $database->getFieldLevel($indi['wid'],$indi['field']);
$this->recountPop($indi['wid']);