Changeset - r10954:0ef68a5d0f8b
[Not reviewed]
master
0 2 0
belugas - 16 years ago 2009-01-29 03:12:31
belugas@openttd.org
(svn r15293) -Feature [FS#2583]: Give a more meaningful message when towns refuse construction of noise-controlled airports
2 files changed with 10 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -1850,12 +1850,13 @@ STR_202F_SUBSIDY_WITHDRAWN_SERVICE      
 
STR_2030_SERVICE_SUBSIDY_OFFERED                                :{BLACK}{BIGFONT}Service subsidy offered:{}{}First {STRING} service from {STRING2} to {STRING2} will attract a year's subsidy from the local authority!
 
STR_2031_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay 50% extra for the next year!
 
STR_2032_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay double rates for the next year!
 
STR_2033_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay triple rates for the next year!
 
STR_2034_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay quadruple rates for the next year!
 
STR_2035_LOCAL_AUTHORITY_REFUSES                                :{WHITE}{TOWN} local authority refuses to allow another airport to be built in this town
 
STR_LOCAL_AUTHORITY_REFUSES_NOISE                               :{WHITE}{TOWN} local authority refuses permission for airport due to noise concerns
 
STR_2036_COTTAGES                                               :Cottages
 
STR_2037_HOUSES                                                 :Houses
 
STR_2038_FLATS                                                  :Flats
 
STR_2039_TALL_OFFICE_BLOCK                                      :Tall office block
 
STR_203A_SHOPS_AND_OFFICES                                      :Shops and offices
 
STR_203B_SHOPS_AND_OFFICES                                      :Shops and offices
src/station_cmd.cpp
Show inline comments
 
@@ -1892,29 +1892,33 @@ CommandCost CmdBuildAirport(TileIndex ti
 

	
 
	/* Go get the final noise level, that is base noise minus factor from distance to town center */
 
	Town *nearest = AirportGetNearestTown(afc, tile);
 
	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)) {
 
		st = GetStationAround(tile, w, h, INVALID_STATION);
 
		if (st == CHECK_STATIONS_ERR) return CMD_ERROR;
 
	} else {
0 comments (0 inline, 0 general)