Changeset - r14643:fa9e3729c00b
[Not reviewed]
master
0 1 0
terkhen - 14 years ago 2010-02-24 22:40:43
terkhen@openttd.org
(svn r19232) -Fix (r19231): Forbid overbuilding drive-through stops using a different orientation.
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -823,24 +823,28 @@ static CommandCost CheckFlatLandRoadStop
 
		/* If station is set, then we have special handling to allow building on top of already existing stations.
 
		 * Station points to INVALID_STATION if we can build on any station.
 
		 * Or it points to a station if we're only allowed to build on exactly that station. */
 
		if (station != NULL && IsTileType(cur_tile, MP_STATION)) {
 
			if (!IsRoadStop(cur_tile)) {
 
				return ClearTile_Station(cur_tile, DC_AUTO); // Get error message.
 
			} else {
 
				if (is_truck_stop != IsTruckStop(cur_tile) ||
 
						is_drive_through != IsDriveThroughStopTile(cur_tile) ||
 
						HasBit(rts, ROADTYPE_TRAM) != HasBit(GetRoadTypes(cur_tile), ROADTYPE_TRAM)) {
 
					return ClearTile_Station(cur_tile, DC_AUTO); // Get error message.
 
				}
 
				/* Drive-through station in the wrong direction. */
 
				if (is_drive_through && IsDriveThroughStopTile(cur_tile) && DiagDirToAxis(GetRoadStopDir(cur_tile)) != axis){
 
					return_cmd_error(STR_ERROR_DRIVE_THROUGH_DIRECTION);
 
				}
 
				StationID st = GetStationIndex(cur_tile);
 
				if (*station == INVALID_STATION) {
 
					*station = st;
 
				} else if (*station != st) {
 
					return_cmd_error(STR_ERROR_ADJOINS_MORE_THAN_ONE_EXISTING);
 
				}
 
			}
 
		} 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);
 

	
0 comments (0 inline, 0 general)