Add: new town council "indifferent" attitude

Closes: #184
This commit is contained in:
Yourself
2020-08-26 22:05:59 -07:00
committed by Jonathan G Rennison
parent ed9410aba9
commit 310bb876a2
6 changed files with 25 additions and 9 deletions

View File

@@ -38,6 +38,8 @@ static const uint TOWN_GROWTH_DESERT = 0xFFFFFFFF; ///< The town needs the cargo
static const uint16 TOWN_GROWTH_RATE_NONE = 0xFFFF; ///< Special value for Town::growth_rate to disable town growth.
static const uint16 MAX_TOWN_GROWTH_TICKS = 930; ///< Max amount of original town ticks that still fit into uint16, about equal to UINT16_MAX / TOWN_GROWTH_TICKS but slightly less to simplify calculations
static const byte TOWN_COUNCIL_INDIFFERENT = 0xFF;
typedef Pool<Town, TownID, 64, 64000> TownPool;
extern TownPool _town_pool;
@@ -148,7 +150,7 @@ struct Town : TownPool::PoolItem<&_town_pool> {
*/
inline uint16 MaxTownNoise() const
{
if (this->cache.population == 0) return 0; // no population? no noise
if (this->cache.population == 0 || _settings_game.difficulty.town_council_tolerance == TOWN_COUNCIL_INDIFFERENT) return 0; // no population? no noise
/* 3 is added (the noise of the lowest airport), so the user can at least build a small airfield. */
return (this->cache.population / _settings_game.economy.town_noise_population[_settings_game.difficulty.town_council_tolerance]) + 3;