mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-03 11:04:24 +00:00
fixes by songeriux + minor changes
This commit is contained in:
+5
-33
@@ -533,20 +533,14 @@ class Battle {
|
||||
$total_att_units = count($units['Att_unit']);
|
||||
$start = intval(($att_tribe-1)*10+1);
|
||||
$end = intval(($att_tribe*10));
|
||||
//exit($start."|".$end."|".$att_tribe);
|
||||
//$y=1;
|
||||
|
||||
for($i=$start;$i <= $end;$i++)
|
||||
{
|
||||
$y = $i-(($att_tribe-1)*10);
|
||||
//exit(intval("$y"));
|
||||
$result['casualties_attacker'][$y] = round($result[1]*$units['Att_unit'][$i]);
|
||||
//$y++;
|
||||
//exit($result['casualties_attacker'][$y]);
|
||||
|
||||
}
|
||||
//$result['casualties_attacker']['11'] = 0;
|
||||
//exit($result['casualties_attacker']['2']);
|
||||
//$_hero=11;
|
||||
|
||||
if ($units['Att_unit']['hero']>0)
|
||||
{
|
||||
|
||||
@@ -568,18 +562,9 @@ class Battle {
|
||||
mysql_query("update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
|
||||
}
|
||||
}
|
||||
unset($_result);
|
||||
unset($fdb);
|
||||
unset($hero_id);
|
||||
unset($hero_health);
|
||||
unset($damage_health);
|
||||
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
||||
|
||||
//exit($result['casualties_attacker']['11']);
|
||||
//$result['casualties_attacker'][11] = round($result[1]*$units['Att_unit']['hero']);
|
||||
|
||||
//$result['casualties_defender']['11'] = 0;
|
||||
//exit($result['casualties_defender']['2']);
|
||||
//$_hero=11;
|
||||
if ($units['Def_unit']['hero']>0)
|
||||
{
|
||||
|
||||
@@ -588,7 +573,6 @@ class Battle {
|
||||
$hero_id=$fdb['heroid'];
|
||||
$hero_health=$fdb['health'];
|
||||
$damage_health=round(100*$result[2]);
|
||||
//exit($damage_health."|".$hero_health."|".$defhero['heroid']);
|
||||
if ($hero_health<=$damage_health or $damage_health>90)
|
||||
{
|
||||
//hero die
|
||||
@@ -601,11 +585,7 @@ class Battle {
|
||||
$result['deadherodef'] = 0;
|
||||
mysql_query("update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
|
||||
}
|
||||
unset($_result);
|
||||
unset($fdb);
|
||||
unset($hero_id);
|
||||
unset($hero_health);
|
||||
unset($damage_health);
|
||||
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
||||
|
||||
$DefendersAll = $database->getEnforceVillage($DefenderWref,0);
|
||||
if(!empty($DefendersAll)){
|
||||
@@ -619,7 +599,6 @@ class Battle {
|
||||
$hero_id=$fdb['heroid'];
|
||||
$hero_health=$fdb['health'];
|
||||
$damage_health=round(100*$result[2]);
|
||||
//exit($damage_health."|".$hero_health."|".$defhero['heroid']);
|
||||
if ($hero_health<=$damage_health or $damage_health>90)
|
||||
{
|
||||
//hero die
|
||||
@@ -637,14 +616,7 @@ class Battle {
|
||||
}
|
||||
|
||||
}
|
||||
unset($_result);
|
||||
unset($fdb);
|
||||
unset($hero_id);
|
||||
unset($hero_health);
|
||||
unset($damage_health);
|
||||
|
||||
//exit($result['casualties_defender']['11']);
|
||||
//$result['casualties_defender'][11] = round($result[1]*$units['Def_unit']['hero']);
|
||||
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
||||
|
||||
|
||||
// Work out bounty
|
||||
|
||||
Reference in New Issue
Block a user