From 64d8f15dbd86a1a59fc88c618834dfd913522422 Mon Sep 17 00:00:00 2001 From: armando1980 Date: Sun, 26 Jan 2014 12:17:21 -0500 Subject: [PATCH] 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 --- GameEngine/Automation.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 0d39f1dc..60643049 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -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']);