fix crop consumption with horse drinking trough (now the consumption down to trained soldiers too) + fix duration

This commit is contained in:
unknown
2012-04-09 01:11:51 +03:00
parent 8e39b56226
commit acf620f833
8 changed files with 24 additions and 19 deletions
+11 -10
View File
@@ -365,23 +365,24 @@ class Technology {
break;
}
for($i=$start;$i<=$end;$i++) {
$hdt = 0;
if($i>=4 && $i<=6) {
for($j=19;$j<=38;$j++) {
if($buildarray['f'.$j.'t'] == 41) {
$hdt = 1;
}
}
}
$unit = "u".$i;
global $$unit;
$dataarray = $$unit;
$upkeep += ($dataarray['pop'] - $hdt) * $array[$unit];
for($j=19;$j<=38;$j++) {
if($buildarray['f'.$j.'t'] == 41) {
$horsedrinking = $j;
}
}
if($i>=4 && $i<=6 && $dataarray['drinking'] <= $buildarray['f'.$horsedrinking]) {
$upkeep += ($dataarray['pop']-1) * $array[$unit];
}else{
$upkeep += $dataarray['pop'] * $array[$unit];
}
}
// $unit = "hero";
// global $$unit;
// $dataarray = $$unit;
$upkeep += $array['hero'] * 6;
$upkeep += $array['hero'] * 6;
return $upkeep;
}