diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index f87c5439..625a958c 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -3261,12 +3261,9 @@ $crannyimg = "getUnit($hdata['wref']); - if($hero_info['dead'] == 1 or $villunits['hero'] == 1){ - mysql_query("UPDATE " . TB_PREFIX . "hero SET nothome = 0 WHERE heroid = ".$hdata['heroid'].""); - } - if($villunits['hero'] == 0 && $hero_info['trainingtime'] < time() && $hero_info['nothome'] == 0){ + if($villunits['hero'] == 0 && $hero_info['trainingtime'] < time() && $hero_info['inrevive'] == 1){ mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$hdata['wref'].""); - mysql_query("UPDATE ".TB_PREFIX."hero SET `dead` = '0', `health` = '100' WHERE `uid` = '".$hdata['uid']."'"); + mysql_query("UPDATE ".TB_PREFIX."hero SET `dead` = '0', `inrevive` = '0', `health` = '100' WHERE `uid` = '".$hdata['uid']."'"); } } } diff --git a/GameEngine/Units.php b/GameEngine/Units.php index 812c3381..8c23e861 100644 --- a/GameEngine/Units.php +++ b/GameEngine/Units.php @@ -332,10 +332,6 @@ class Units { $checkoexist = $database->checkOasisExist($data['to_vid']); if($checkexist or $checkoexist){ $database->addMovement(3,$village->wid,$data['to_vid'],$reference,time(),($time+time())); - if($data['u11'] > 0){ - $heroid = $database->getHero($session->uid); - mysql_query("UPDATE " . TB_PREFIX . "hero SET nothome = 1 WHERE heroid = ".$heroid.""); - } } if($form->returnErrors() > 0) { diff --git a/Templates/Build/37_revive.tpl b/Templates/Build/37_revive.tpl index 31461483..cf6e9e39 100644 --- a/Templates/Build/37_revive.tpl +++ b/Templates/Build/37_revive.tpl @@ -71,7 +71,7 @@ time()) { + if($hero_info['inrevive'] == 1) { $timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time()); ?> @@ -161,9 +161,9 @@ access != BANNED){ - mysql_query("UPDATE ".TB_PREFIX."hero SET `dead` = '0', `health` = '100', `trainingtime` = '".$training_time2."' WHERE `uid` = '".$session->uid."'"); + mysql_query("UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".$training_time2."' WHERE `uid` = '".$session->uid."'"); mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$wood." WHERE `wref` = '" . $village->wid . "'"); mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$clay." WHERE `wref` = '" . $village->wid . "'"); mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `wood` - ".$iron." WHERE `wref` = '" . $village->wid . "'"); @@ -173,10 +173,7 @@ header("Location: banned.php"); } } -if($hero_info['trainingtime'] < time() && $hero_info['dead'] == 0 && $hero_info['nothome'] == 0){ -mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$village->wid.""); -} - if($hero_info['trainingtime'] < time()) { + if($hero_info['inrevive'] == 0) { include ("37_train.tpl"); } ?> \ No newline at end of file diff --git a/install/data/sql.sql b/install/data/sql.sql index 07f804e9..d9beccd1 100644 --- a/install/data/sql.sql +++ b/install/data/sql.sql @@ -806,7 +806,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%hero` ( `regeneration` tinyint(3) unsigned NOT NULL, `autoregen` int(2) NOT NULL, `trainingtime` int(11) unsigned NOT NULL, - `nothome` tinyint(1) unsigned NOT NULL, + `inrevive` tinyint(1) unsigned NOT NULL, PRIMARY KEY (`heroid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;