diff --git a/Admin/Templates/update_latest.tpl b/Admin/Templates/update_latest.tpl index e20fbc52..2658f203 100644 --- a/Admin/Templates/update_latest.tpl +++ b/Admin/Templates/update_latest.tpl @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index d9ec2f09..4cbe2062 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -3848,11 +3848,11 @@ $crannyimg = "getUnit($hdata['wref']); if($villunits['hero'] == 0 && $hdata['trainingtime'] < time() && $hdata['inrevive'] == 1){ mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$hdata['wref'].""); - mysql_query("UPDATE ".TB_PREFIX."hero SET `dead` = '0', `inrevive` = '0', `health` = '100' WHERE `uid` = '".$hdata['uid']."'"); + mysql_query("UPDATE ".TB_PREFIX."hero SET `dead` = '0', `inrevive` = '0', `health` = '100', `lastupdate` = ".$hdata['trainingtime']." WHERE `uid` = '".$hdata['uid']."'"); } if($villunits['hero'] == 0 && $hdata['trainingtime'] < time() && $hdata['intraining'] == 1){ mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$hdata['wref'].""); - mysql_query("UPDATE ".TB_PREFIX."hero SET `intraining` = '0' WHERE `uid` = '".$hdata['uid']."'"); + mysql_query("UPDATE ".TB_PREFIX."hero SET `intraining` = '0', `lastupdate` = ".$hdata['trainingtime']." WHERE `uid` = '".$hdata['uid']."'"); } } } diff --git a/Templates/Plus/10.tpl b/Templates/Plus/10.tpl index 78a0d84c..44ff814e 100644 --- a/Templates/Plus/10.tpl +++ b/Templates/Plus/10.tpl @@ -21,7 +21,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { -if($golds['b2'] == 0) { +if($golds['b2'] < time()) { 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 b511bb83..3914f63a 100644 --- a/Templates/Plus/11.tpl +++ b/Templates/Plus/11.tpl @@ -21,7 +21,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { -if($golds['b3'] == 0) { +if($golds['b3'] < time()) { 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 106f2fca..3142525d 100644 --- a/Templates/Plus/12.tpl +++ b/Templates/Plus/12.tpl @@ -21,7 +21,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { -if($golds['b4'] == 0) { +if($golds['b4'] < time()) { 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 2420d93a..cffba573 100644 --- a/Templates/Plus/9.tpl +++ b/Templates/Plus/9.tpl @@ -21,7 +21,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { -if($golds['b1'] == 0) { +if($golds['b1'] < time()) { 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()); diff --git a/install/data/sql.sql b/install/data/sql.sql index 6fffd9af..e4c0bba2 100644 --- a/install/data/sql.sql +++ b/install/data/sql.sql @@ -811,6 +811,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%hero` ( `defencebonus` tinyint(3) unsigned NOT NULL, `regeneration` tinyint(3) unsigned NOT NULL, `autoregen` int(2) NOT NULL, + `lastupdate` int(11) unsigned NOT NULL, `trainingtime` int(11) unsigned NOT NULL, `inrevive` tinyint(1) unsigned NOT NULL, `intraining` tinyint(1) unsigned NOT NULL,