Clarify how the "town growth speed depends on transported cargo" setting works

This commit is contained in:
Jonathan G Rennison
2023-03-26 22:37:44 +01:00
parent c39f6abcb2
commit ce5c758f2b
2 changed files with 5 additions and 1 deletions

View File

@@ -4024,6 +4024,10 @@ static uint GetNormalGrowthRate(Town *t)
if (t->larger_town) m /= 2;
if (_settings_game.economy.town_growth_cargo_transported > 0) {
/* The standard growth rate here is proportional to 1/m.
* town_growth_cargo_transported percent of the growth rate is multiplied by the proportion of town cargoes transported.
* The growth rate can only be decreased by this setting, not increased.
*/
uint32 inverse_m = UINT32_MAX / m;
auto calculate_cargo_ratio_fix15 = [](const TransportedCargoStat<uint32> &stat) -> uint32 {
return stat.old_max ? ((uint64) (stat.old_act << 15)) / stat.old_max : 1 << 15;