summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2009-01-29 03:12:31 +0000
committerbelugas <belugas@openttd.org>2009-01-29 03:12:31 +0000
commitd7971e5e373cc510aae5f7085928117bf9d95a84 (patch)
treef769d9110d5ef0eb4b5f84314fb6718b1183f165 /src/station_cmd.cpp
parent31adec86a0340b13eb50f84d44bb3e71b2648cde (diff)
downloadopenttd-d7971e5e373cc510aae5f7085928117bf9d95a84.tar.xz
(svn r15293) -Feature [FS#2583]: Give a more meaningful message when towns refuse construction of noise-controlled airports
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 4f1c5363c..67f1dbab6 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1895,23 +1895,27 @@ CommandCost CmdBuildAirport(TileIndex tile, uint32 flags, uint32 p1, uint32 p2,
uint newnoise_level = GetAirportNoiseLevelForTown(afc, nearest->xy, tile);
/* Check if local auth would allow a new airport */
- bool authority_refused;
+ StringID authority_refuse_message = STR_NULL;
if (_settings_game.economy.station_noise_level) {
/* do not allow to build a new airport if this raise the town noise over the maximum allowed by town */
- authority_refused = (nearest->noise_reached + newnoise_level) > nearest->MaxTownNoise();
+ if ((nearest->noise_reached + newnoise_level) > nearest->MaxTownNoise()) {
+ authority_refuse_message = STR_LOCAL_AUTHORITY_REFUSES_NOISE;
+ }
} else {
uint num = 0;
const Station *st;
FOR_ALL_STATIONS(st) {
if (st->town == t && st->facilities & FACIL_AIRPORT && st->airport_type != AT_OILRIG) num++;
}
- authority_refused = (num >= 2);
+ if (num >= 2) {
+ authority_refuse_message = STR_2035_LOCAL_AUTHORITY_REFUSES;
+ }
}
- if (authority_refused) {
+ if (authority_refuse_message != STR_NULL) {
SetDParam(0, t->index);
- return_cmd_error(STR_2035_LOCAL_AUTHORITY_REFUSES);
+ return_cmd_error(authority_refuse_message);
}
if (!_settings_game.station.adjacent_stations || !HasBit(p2, 0)) {