File diff r10129:c2bd7bc13408 → r10130:205e8ead41fd
src/road_cmd.cpp
Show inline comments
 
@@ -520,16 +520,17 @@ CommandCost CmdBuildRoad(TileIndex tile,
 
						}
 
						return_cmd_error(STR_1007_ALREADY_BUILT);
 
					}
 
				} break;
 

	
 
				case ROAD_TILE_CROSSING:
 
					if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
 
					other_bits = GetCrossingRoadBits(tile);
 
					if (pieces & ComplementRoadBits(other_bits)) goto do_clear;
 
					pieces = other_bits; // we need to pay for both roadbits
 

	
 
					if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
 
					break;
 

	
 
				default:
 
				case ROAD_TILE_DEPOT:
 
					goto do_clear;
 
			}
 
@@ -575,17 +576,18 @@ CommandCost CmdBuildRoad(TileIndex tile,
 
			}
 
			return CommandCost(EXPENSES_CONSTRUCTION, _price.build_road * (rt == ROADTYPE_ROAD ? 2 : 4));
 
		}
 

	
 
		case MP_STATION: {
 
			if (!IsDriveThroughStopTile(tile)) goto do_clear;
 
			if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
 

	
 
			RoadBits curbits = AxisToRoadBits(DiagDirToAxis(GetRoadStopDir(tile)));
 
			if (pieces & ~curbits) goto do_clear;
 
			pieces = curbits; // we need to pay for both roadbits
 

	
 
			if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
 
		} break;
 

	
 
		case MP_TUNNELBRIDGE:
 
			if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
 
			if (MirrorRoadBits(DiagDirToRoadBits(GetTunnelBridgeDirection(tile))) != pieces) return CMD_ERROR;
 
			if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);