From 11cbccbfad002cd8fa2a5a7aad01ecc731e7998c Mon Sep 17 00:00:00 2001 From: Shadow Date: Sat, 21 Dec 2013 10:10:02 +0200 Subject: [PATCH] Update Automation.php --- GameEngine/Automation.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 2351cafb..c0395ac6 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -2498,7 +2498,9 @@ class Automation { } else { $xp=" but gained ".$heroxp." XP from the battle"; } - $info_hero = $hero_pic.",Your hero die".$xp; + if ($traped11>0) { + $info_hero = $hero_pic.",Your hero has trapped".$xp; + }else $info_hero = $hero_pic.",Your hero die".$xp; } if ($DefenderID==0) { $natar=0; @@ -2779,7 +2781,7 @@ $wallimg = "modifyPointsAlly($ownally,'RR',$totalstolengain); } }else{ //fix by ronix if only 1 chief left to conqured - don't add with zero enforces - if($totalsend_att - ($totaldead_att+$totaltraped_att) > 0) { + if($totalsend_att - ($totaldead_att+$totaltraped_att) > 1) { $database->addEnforce2($data,$owntribe,$troopsdead1,$troopsdead2,$troopsdead3,$troopsdead4,$troopsdead5,$troopsdead6,$troopsdead7,$troopsdead8,$troopsdead9,$troopsdead10,$troopsdead11); } } @@ -4392,7 +4394,7 @@ $wallimg = "query_return($q); - if(count($enforcearray)>0){ + if(count($enforcearray)==0){ foreach ($enforcearray as $enforce){ for($i = 0 ; $i <= 50 ; $i++){ $units = $enforce['u'.$i]; @@ -4450,21 +4452,16 @@ $wallimg = "0 && $oldcrop <=0) { + if ($hungry['crop']>0) { $killunits = intval($difcrop/$hungry['crop']); }else $killunits=0; if($killunits > 0){ - $pskolko = abs($skolko); - if($killunits > $pskolko && $skolko <0){ - $killunits = $pskolko; - } if (isset($enf)){ if($killunits < $maxcount){ $database->modifyEnforce($enf, $maxtype, $killunits, 0); $database->setVillageField($starv['wref'], 'starv', $upkeep); $database->setVillageField($starv['wref'], 'starvupdate', $time); - $database->modifyResource($starv['wref'],0,0,0,$hungry['crop'],1); if($maxtype == "hero"){ $heroid = $database->getHeroField($database->getVillageField($enf,"owner"),"heroid"); $database->modifyHero("dead", 1, $heroid); @@ -4479,7 +4476,6 @@ $wallimg = "modifyUnit($starv['wref'], array($maxtype), array($killunits), array(0)); $database->setVillageField($starv['wref'], 'starv', $upkeep); $database->setVillageField($starv['wref'], 'starvupdate', $time); - $database->modifyResource($starv['wref'],0,0,0,$hungry['crop'],1); if($maxtype == "hero"){ $heroid = $database->getHeroField($starv['owner'],"heroid"); $database->modifyHero("dead", 1, $heroid);