Changeset - r6768:adee51ded6c1
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-05-31 18:12:35
rubidium@openttd.org
(svn r10004) -Fix: trams can always intersect/have junctions on one way roads (because they only work for busses and lorries).
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/road_cmd.cpp
Show inline comments
 
@@ -366,26 +366,26 @@ int32 CmdBuildRoad(TileIndex tile, uint3
 
	switch (GetTileType(tile)) {
 
		case MP_STREET:
 
			switch (GetRoadTileType(tile)) {
 
				case ROAD_TILE_NORMAL: {
 
					if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS);
 
					if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 

	
 
					all_bits = GetAllRoadBits(tile);
 
					if (!HASBIT(GetRoadTypes(tile), rt)) break;
 

	
 
					existing = GetRoadBits(tile, rt);
 
					RoadBits merged = existing | pieces;
 
					bool crossing = (merged & ROAD_X) != ROAD_NONE && (merged & ROAD_Y) != ROAD_NONE;
 
					if (GetDisallowedRoadDirections(tile) != DRD_NONE && crossing) {
 
					bool crossing = (merged != ROAD_X && merged != ROAD_Y);
 
					if (rt != ROADTYPE_TRAM && (GetDisallowedRoadDirections(tile) != DRD_NONE || toggle_drd != DRD_NONE) && crossing) {
 
						/* Junctions cannot be one-way */
 
						return_cmd_error(STR_ERR_ONEWAY_ROADS_CAN_T_HAVE_JUNCTION);
 
					}
 
					if ((existing & pieces) == pieces) {
 
						/* We only want to set the (dis)allowed road directions */
 
						if (toggle_drd != DRD_NONE && rt != ROADTYPE_TRAM && GetRoadOwner(tile, ROADTYPE_ROAD) == _current_player) {
 
							if (crossing) return_cmd_error(STR_ERR_ONEWAY_ROADS_CAN_T_HAVE_JUNCTION);
 

	
 
							/* Ignore half built tiles */
 
							if (flags & DC_EXEC && rt != ROADTYPE_TRAM && (existing == ROAD_X || existing == ROAD_Y)) {
 
								SetDisallowedRoadDirections(tile, GetDisallowedRoadDirections(tile) ^ toggle_drd);
 
								MarkTileDirtyByTile(tile);
0 comments (0 inline, 0 general)