Changeset - r22891:dcb074e6dc1c
[Not reviewed]
master
0 2 0
Peter Nelson - 6 years ago 2018-06-03 20:58:34
peter1138@openttd.org
Fix: One-way roads could be over-built by road stops (regardless of road owner.)
2 files changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -4213,48 +4213,49 @@ STR_ERROR_NO_SUITABLE_PLACES_FOR_INDUSTR
 

	
 
# Station construction related errors
 
STR_ERROR_CAN_T_BUILD_RAILROAD_STATION                          :{WHITE}Can't build railway station here...
 
STR_ERROR_CAN_T_BUILD_BUS_STATION                               :{WHITE}Can't build bus station...
 
STR_ERROR_CAN_T_BUILD_TRUCK_STATION                             :{WHITE}Can't build lorry station...
 
STR_ERROR_CAN_T_BUILD_PASSENGER_TRAM_STATION                    :{WHITE}Can't build passenger tram station...
 
STR_ERROR_CAN_T_BUILD_CARGO_TRAM_STATION                        :{WHITE}Can't build freight tram station...
 
STR_ERROR_CAN_T_BUILD_DOCK_HERE                                 :{WHITE}Can't build dock here...
 
STR_ERROR_CAN_T_BUILD_AIRPORT_HERE                              :{WHITE}Can't build airport here...
 

	
 
STR_ERROR_ADJOINS_MORE_THAN_ONE_EXISTING                        :{WHITE}Adjoins more than one existing station/loading area
 
STR_ERROR_STATION_TOO_SPREAD_OUT                                :{WHITE}... station too spread out
 
STR_ERROR_TOO_MANY_STATIONS_LOADING                             :{WHITE}Too many stations/loading areas
 
STR_ERROR_TOO_MANY_STATION_SPECS                                :{WHITE}Too many railway station parts
 
STR_ERROR_TOO_MANY_BUS_STOPS                                    :{WHITE}Too many bus stops
 
STR_ERROR_TOO_MANY_TRUCK_STOPS                                  :{WHITE}Too many lorry stations
 
STR_ERROR_TOO_CLOSE_TO_ANOTHER_STATION                          :{WHITE}Too close to another station/loading area
 
STR_ERROR_TOO_CLOSE_TO_ANOTHER_DOCK                             :{WHITE}Too close to another dock
 
STR_ERROR_TOO_CLOSE_TO_ANOTHER_AIRPORT                          :{WHITE}Too close to another airport
 
STR_ERROR_CAN_T_RENAME_STATION                                  :{WHITE}Can't rename station...
 
STR_ERROR_DRIVE_THROUGH_ON_TOWN_ROAD                            :{WHITE}... this is a town owned road
 
STR_ERROR_DRIVE_THROUGH_DIRECTION                               :{WHITE}... road facing in the wrong direction
 
STR_ERROR_DRIVE_THROUGH_CORNER                                  :{WHITE}... drive through stops can't have corners
 
STR_ERROR_DRIVE_THROUGH_JUNCTION                                :{WHITE}... drive through stops can't have junctions
 
STR_ERROR_DRIVE_THROUGH_ON_ONEWAY_ROAD                          :{WHITE}... road is one way or blocked
 

	
 
# Station destruction related errors
 
STR_ERROR_CAN_T_REMOVE_PART_OF_STATION                          :{WHITE}Can't remove part of station...
 
STR_ERROR_MUST_REMOVE_RAILWAY_STATION_FIRST                     :{WHITE}Must remove railway station first
 
STR_ERROR_CAN_T_REMOVE_BUS_STATION                              :{WHITE}Can't remove bus station...
 
STR_ERROR_CAN_T_REMOVE_TRUCK_STATION                            :{WHITE}Can't remove lorry station...
 
STR_ERROR_CAN_T_REMOVE_PASSENGER_TRAM_STATION                   :{WHITE}Can't remove passenger tram station...
 
STR_ERROR_CAN_T_REMOVE_CARGO_TRAM_STATION                       :{WHITE}Can't remove freight tram station...
 
STR_ERROR_MUST_REMOVE_ROAD_STOP_FIRST                           :{WHITE}Must remove road stop first
 
STR_ERROR_THERE_IS_NO_STATION                                   :{WHITE}... there is no station here
 

	
 
STR_ERROR_MUST_DEMOLISH_RAILROAD                                :{WHITE}Must demolish railway station first
 
STR_ERROR_MUST_DEMOLISH_BUS_STATION_FIRST                       :{WHITE}Must demolish bus station first
 
STR_ERROR_MUST_DEMOLISH_TRUCK_STATION_FIRST                     :{WHITE}Must demolish lorry station first
 
STR_ERROR_MUST_DEMOLISH_PASSENGER_TRAM_STATION_FIRST            :{WHITE}Must demolish passenger tram station first
 
STR_ERROR_MUST_DEMOLISH_CARGO_TRAM_STATION_FIRST                :{WHITE}Must demolish freight tram station first
 
STR_ERROR_MUST_DEMOLISH_DOCK_FIRST                              :{WHITE}Must demolish dock first
 
STR_ERROR_MUST_DEMOLISH_AIRPORT_FIRST                           :{WHITE}Must demolish airport first
 

	
 
# Waypoint related errors
 
STR_ERROR_WAYPOINT_ADJOINS_MORE_THAN_ONE_EXISTING               :{WHITE}Adjoins more than one existing waypoint
 
STR_ERROR_TOO_CLOSE_TO_ANOTHER_WAYPOINT                         :{WHITE}Too close to another waypoint
 

	
 
STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT                            :{WHITE}Can't build train waypoint here...
src/station_cmd.cpp
Show inline comments
 
@@ -939,48 +939,50 @@ static CommandCost CheckFlatLandRoadStop
 
					case 2:
 
						if (rb == ROAD_X || rb == ROAD_Y) return_cmd_error(STR_ERROR_DRIVE_THROUGH_DIRECTION);
 
						return_cmd_error(STR_ERROR_DRIVE_THROUGH_CORNER);
 

	
 
					default: // 3 or 4
 
						return_cmd_error(STR_ERROR_DRIVE_THROUGH_JUNCTION);
 
				}
 
			}
 

	
 
			RoadTypes cur_rts = IsNormalRoadTile(cur_tile) ? GetRoadTypes(cur_tile) : ROADTYPES_NONE;
 
			uint num_roadbits = 0;
 
			if (build_over_road) {
 
				/* There is a road, check if we can build road+tram stop over it. */
 
				if (HasBit(cur_rts, ROADTYPE_ROAD)) {
 
					Owner road_owner = GetRoadOwner(cur_tile, ROADTYPE_ROAD);
 
					if (road_owner == OWNER_TOWN) {
 
						if (!_settings_game.construction.road_stop_on_town_road) return_cmd_error(STR_ERROR_DRIVE_THROUGH_ON_TOWN_ROAD);
 
					} else if (!_settings_game.construction.road_stop_on_competitor_road && road_owner != OWNER_NONE) {
 
						CommandCost ret = CheckOwnership(road_owner);
 
						if (ret.Failed()) return ret;
 
					}
 
					num_roadbits += CountBits(GetRoadBits(cur_tile, ROADTYPE_ROAD));
 
				}
 

	
 
				if (GetDisallowedRoadDirections(cur_tile) != DRD_NONE) return_cmd_error(STR_ERROR_DRIVE_THROUGH_ON_ONEWAY_ROAD);
 

	
 
				/* There is a tram, check if we can build road+tram stop over it. */
 
				if (HasBit(cur_rts, ROADTYPE_TRAM)) {
 
					Owner tram_owner = GetRoadOwner(cur_tile, ROADTYPE_TRAM);
 
					if (Company::IsValidID(tram_owner) &&
 
							(!_settings_game.construction.road_stop_on_competitor_road ||
 
							/* Disallow breaking end-of-line of someone else
 
							 * so trams can still reverse on this tile. */
 
							HasExactlyOneBit(GetRoadBits(cur_tile, ROADTYPE_TRAM)))) {
 
						CommandCost ret = CheckOwnership(tram_owner);
 
						if (ret.Failed()) return ret;
 
					}
 
					num_roadbits += CountBits(GetRoadBits(cur_tile, ROADTYPE_TRAM));
 
				}
 

	
 
				/* Take into account existing roadbits. */
 
				rts |= cur_rts;
 
			} else {
 
				ret = DoCommand(cur_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
				if (ret.Failed()) return ret;
 
				cost.AddCost(ret);
 
			}
 

	
 
			uint roadbits_to_build = CountBits(rts) * 2 - num_roadbits;
 
			cost.AddCost(_price[PR_BUILD_ROAD] * roadbits_to_build);
0 comments (0 inline, 0 general)