diff --git a/src/lang/english.txt b/src/lang/english.txt index dfaddd368d..17d9770f6a 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -4004,6 +4004,7 @@ STR_TOWN_VIEW_TOWN_GROWS_EVERY :{BLACK}Town gro STR_TOWN_VIEW_TOWN_GROWS_EVERY_FUNDED :{BLACK}Town grows every {ORANGE}{COMMA}{BLACK}{NBSP}day{P "" s} (funded) STR_TOWN_VIEW_TOWN_GROW_STOPPED :{BLACK}Town is {RED}not{BLACK} growing STR_TOWN_VIEW_NOISE_IN_TOWN :{BLACK}Noise limit in town: {ORANGE}{COMMA}{BLACK} max: {ORANGE}{COMMA} +STR_TOWN_VIEW_NOISE_IN_TOWN_NO_LIMIT :{BLACK}Noise limit in town: {ORANGE}{COMMA} STR_TOWN_VIEW_CENTER_TOOLTIP :{BLACK}Centre the main view on town location. Ctrl+Click opens a new viewport on town location STR_TOWN_VIEW_LOCAL_AUTHORITY_BUTTON :{BLACK}Local authority STR_TOWN_VIEW_LOCAL_AUTHORITY_TOOLTIP :{BLACK}Show information on local authority diff --git a/src/town.h b/src/town.h index cca54689eb..2485d604a3 100644 --- a/src/town.h +++ b/src/town.h @@ -150,7 +150,9 @@ struct Town : TownPool::PoolItem<&_town_pool> { */ inline uint16 MaxTownNoise() const { - if (this->cache.population == 0 || _settings_game.difficulty.town_council_tolerance == TOWN_COUNCIL_INDIFFERENT) return 0; // no population? no noise + if (_settings_game.difficulty.town_council_tolerance == TOWN_COUNCIL_INDIFFERENT) return UINT16_MAX; + + if (this->cache.population == 0) 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; diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 0406abe80a..9ce89a91d8 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -435,9 +435,10 @@ public: /* only show the town noise, if the noise option is activated. */ if (_settings_game.economy.station_noise_level) { + uint16 max_noise = this->town->MaxTownNoise(); SetDParam(0, this->town->noise_reached); - SetDParam(1, this->town->MaxTownNoise()); - DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_LEFT, y += FONT_HEIGHT_NORMAL, STR_TOWN_VIEW_NOISE_IN_TOWN); + SetDParam(1, max_noise); + DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_LEFT, y += FONT_HEIGHT_NORMAL, max_noise == UINT16_MAX ? STR_TOWN_VIEW_NOISE_IN_TOWN_NO_LIMIT : STR_TOWN_VIEW_NOISE_IN_TOWN); } if (!this->town->text.empty()) {