diff options
author | rubidium <rubidium@openttd.org> | 2010-08-03 18:32:53 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-08-03 18:32:53 +0000 |
commit | b74cee45be345495e4a84424fc69bcae91f9acf9 (patch) | |
tree | 044db859bf2ced2db2c00a2789323cf131035737 /src | |
parent | fff8524fb9d1ae4a4b4971bf53e7c221ac7c851b (diff) | |
download | openttd-b74cee45be345495e4a84424fc69bcae91f9acf9.tar.xz |
(svn r20356) -Fix [FS#3983]: apparantly one generic error message can't be understood...
Diffstat (limited to 'src')
-rw-r--r-- | src/lang/english.txt | 2 | ||||
-rw-r--r-- | src/station_cmd.cpp | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt index f4e73b01c..4722365c7 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3496,6 +3496,8 @@ STR_ERROR_TOO_CLOSE_TO_ANOTHER_AIRPORT :{WHITE}Too clos 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 # Station destruction related errors STR_ERROR_CAN_T_REMOVE_PART_OF_STATION :{WHITE}Can't remove part of station... diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 9868f60f9..ab4553715 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -862,7 +862,21 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags } else { bool build_over_road = is_drive_through && IsNormalRoadTile(cur_tile); /* Road bits in the wrong direction. */ - if (build_over_road && (GetAllRoadBits(cur_tile) & (axis == AXIS_X ? ROAD_Y : ROAD_X)) != 0) return_cmd_error(STR_ERROR_DRIVE_THROUGH_DIRECTION); + RoadBits rb = GetAllRoadBits(cur_tile); + if (build_over_road && (rb & (axis == AXIS_X ? ROAD_Y : ROAD_X)) != 0) { + /* Someone was pedantic and *NEEDED* three fracking different error messages. */ + switch (CountBits(rb)) { + case 1: + return_cmd_error(STR_ERROR_DRIVE_THROUGH_DIRECTION); + + 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; |