* Update the maximum amount of monthly passengers and mail for a town, based on its population. * @param t The town to update. */
| 2001 | * @param t The town to update. |
| 2002 | */ |
| 2003 | void UpdateTownMaxPass(Town *t) |
| 2004 | { |
| 2005 | for (const CargoSpec *cs : CargoSpec::town_production_cargoes[TPE_PASSENGERS]) { |
| 2006 | uint32_t production = ScaleByCargoScale(t->cache.population >> 3, true); |
| 2007 | if (production == 0) continue; |
| 2008 | |
| 2009 | auto &supplied = t->GetOrCreateCargoSupplied(cs->Index()); |
| 2010 | supplied.history[LAST_MONTH].production = production; |
| 2011 | } |
| 2012 | |
| 2013 | for (const CargoSpec *cs : CargoSpec::town_production_cargoes[TPE_MAIL]) { |
| 2014 | uint32_t production = ScaleByCargoScale(t->cache.population >> 4, true); |
| 2015 | if (production == 0) continue; |
| 2016 | |
| 2017 | auto &supplied = t->GetOrCreateCargoSupplied(cs->Index()); |
| 2018 | supplied.history[LAST_MONTH].production = production; |
| 2019 | } |
| 2020 | } |
| 2021 | |
| 2022 | static void UpdateTownGrowthRate(Town *t); |
| 2023 | static void UpdateTownGrowth(Town *t); |
no test coverage detected