fix: unable to train settlers if chieftan is present

It is debatable whether or not to allow this, since chieftan would be of
no use once we have 3 settlers and settle a new village. However, if we
accidentally created a chieftan, we can't train settlers until we send
the chieftan to his death.

I think this move could be a predule to a later game mechanics, where
chieftan could fight (talk, actually) against chieftan, if one is
present in village, so taking a village over isn't so easy.
This commit is contained in:
Martin Ambrus
2017-11-03 17:23:29 +01:00
parent 5e4521e62e
commit 23eed5da53
3 changed files with 8 additions and 5 deletions
+5 -2
View File
@@ -4115,6 +4115,9 @@ class MYSQLi_DB implements IDbConnection {
}
$settlerarray = $this->getMovement(5, $id, 0);
if(!empty($settlerarray)) {
if (!isset($movingunits['u' . ($vtribe * 10)])) {
$movingunits['u' . ($vtribe * 10)] = 0;
}
$movingunits['u' . ($vtribe * 10)] += 3 * count($settlerarray);
}
return $movingunits;
@@ -4558,9 +4561,9 @@ class MYSQLi_DB implements IDbConnection {
}
}
}
// trapped settlers/chiefs calculation required
// TODO: trapped settlers/chiefs calculation required
$settlerslots = $maxslots * 3 - $settlers - $chiefs * 3;
$settlerslots = $maxslots * 3 - $settlers * 3;
$chiefslots = $maxslots - $chiefs - floor(($settlers + 2) / 3);
if(!$technology->getTech(($session->tribe - 1) * 10 + 9)) {