diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index e7dedc20..4602c2d5 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -145,7 +145,7 @@ class Automation { public function Automation() { - $this->procClimbers(); + $this->ClearUser(); $this->ClearInactive(); $this->oasisResoucesProduce(); @@ -1587,8 +1587,7 @@ class Automation { $heroxp = $totaldead_def; $database->modifyHeroXp("experience",$heroxp,$from['owner']); } - $Defender1 = $database->getUnit($to['wref']); - if($Defender1['hero'] > 0){ + if($Defender['hero'] > 0){ $defheroxp = $totaldead_att; $database->modifyHeroXp("experience",$defheroxp,$toF['owner']); } @@ -2657,8 +2656,8 @@ $crannyimg = "setMovementProc($data['moveid']); if($chiefing_village != 1 && $village_destroyed != 1){ + $database->setMovementProc($data['moveid']); $database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],time(),$endtime); // send the bounty on type 6. if($type !== 1) @@ -2720,6 +2719,7 @@ $crannyimg = "setMovementProc($data['moveid']); $database->addMovement(4,$movedata['to'],$movedata['from'],$movedata['ref'],$time,$time+$time2); $database->setMovementProc($movedata['moveid']); } @@ -2869,7 +2869,6 @@ $crannyimg = "=1){ if($hdata['health']<100 and $hdata['health']>0){ - $reg = $hdata['health']+$hdata['regeneration']*5*ceil(SPEED/10)/86400*(time()-$hdata['lastupdate']); + $reg = $hdata['health']+$hdata['regeneration']*5*SPEED/86400*(time()-$hdata['lastupdate']); if($reg <= 100){ $database->modifyHero("health",$reg,$hdata['heroid']); }else{ diff --git a/Templates/Plus/10.tpl b/Templates/Plus/10.tpl index 05bdcc6f..78a0d84c 100644 --- a/Templates/Plus/10.tpl +++ b/Templates/Plus/10.tpl @@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { if($golds['b2'] == 0) { -mysql_query("UPDATE ".TB_PREFIX."users set b2 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error()); +mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } else { mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".($golds['b2']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } diff --git a/Templates/Plus/11.tpl b/Templates/Plus/11.tpl index b4d9867b..b511bb83 100644 --- a/Templates/Plus/11.tpl +++ b/Templates/Plus/11.tpl @@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { if($golds['b3'] == 0) { -mysql_query("UPDATE ".TB_PREFIX."users set b3 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error()); +mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } else { mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".($golds['b3']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } diff --git a/Templates/Plus/12.tpl b/Templates/Plus/12.tpl index 5ea8a23d..106f2fca 100644 --- a/Templates/Plus/12.tpl +++ b/Templates/Plus/12.tpl @@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { if($golds['b4'] == 0) { -mysql_query("UPDATE ".TB_PREFIX."users set b4 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error()); +mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } else { mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".($golds['b4']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } diff --git a/Templates/Plus/9.tpl b/Templates/Plus/9.tpl index 1bec9abf..2420d93a 100644 --- a/Templates/Plus/9.tpl +++ b/Templates/Plus/9.tpl @@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { if($golds['b1'] == 0) { -mysql_query("UPDATE ".TB_PREFIX."users set b1 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error()); +mysql_query("UPDATE ".TB_PREFIX."users set b1 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } else { mysql_query("UPDATE ".TB_PREFIX."users set b1 = '".($golds['b1']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); }