General fixes

+Fixed a bug that didn't permit to change the name or the Tag of the
alliance individually
+Fixed a bug that didn't count the population growth sometimes
+Fixed a bug that didn't halve the population consumption in WW villages
This commit is contained in:
iopietro
2018-06-08 19:15:39 +02:00
parent db35f9664e
commit a8d6b9c357
6 changed files with 37 additions and 31 deletions
+2 -1
View File
@@ -661,12 +661,13 @@ class adm_DB {
public function calculateProduction($wid, $uid, $b1, $b2, $b3, $b4, $fdata, $ocounter, $pop) {
global $technology, $database;
$isNatar = $database->getVillageField($wid, "natar");
$upkeep = $technology->getUpkeep($this->getAllUnits($wid), 0, $wid);
$production = [];
$production['wood'] = $this->getWoodProd($fdata, $ocounter,$b1);
$production['clay'] = $this->getClayProd($fdata, $ocounter,$b2);
$production['iron'] = $this->getIronProd($fdata, $ocounter,$b3);
$production['crop'] = $this->getCropProd($fdata, $ocounter,$b4) - $pop - $upkeep;
$production['crop'] = $this->getCropProd($fdata, $ocounter,$b4) - (!$isNatar ? $pop : round($pop / 2)) - $upkeep;
return $production;
}