mirror of https://github.com/OpenTTD/OpenTTD
(svn r17239) -Change [FS#2802]: allow overbuilding the front tile of a roadstation / roaddepot with road
to be consistent with overbuilding the front tile of tunnels/bridges and also to make it easier for AIs to connect roadstations and roaddepots to the road in front of itrelease/1.0
parent
edcaf8aa3a
commit
367ff2375a
|
@ -516,9 +516,11 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||||
if (HasTileRoadType(tile, rt)) return_cmd_error(STR_ERROR_ALREADY_BUILT);
|
if (HasTileRoadType(tile, rt)) return_cmd_error(STR_ERROR_ALREADY_BUILT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
case ROAD_TILE_DEPOT:
|
case ROAD_TILE_DEPOT:
|
||||||
|
if ((GetAnyRoadBits(tile, rt) & pieces) == pieces) return_cmd_error(STR_ERROR_ALREADY_BUILT);
|
||||||
goto do_clear;
|
goto do_clear;
|
||||||
|
|
||||||
|
default: NOT_REACHED();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -565,6 +567,7 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
case MP_STATION: {
|
case MP_STATION: {
|
||||||
|
if ((GetAnyRoadBits(tile, rt) & pieces) == pieces) return_cmd_error(STR_ERROR_ALREADY_BUILT);
|
||||||
if (!IsDriveThroughStopTile(tile)) goto do_clear;
|
if (!IsDriveThroughStopTile(tile)) goto do_clear;
|
||||||
|
|
||||||
RoadBits curbits = AxisToRoadBits(DiagDirToAxis(GetRoadStopDir(tile)));
|
RoadBits curbits = AxisToRoadBits(DiagDirToAxis(GetRoadStopDir(tile)));
|
||||||
|
@ -575,8 +578,8 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case MP_TUNNELBRIDGE:
|
case MP_TUNNELBRIDGE:
|
||||||
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
|
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) goto do_clear;
|
||||||
if (MirrorRoadBits(DiagDirToRoadBits(GetTunnelBridgeDirection(tile))) != pieces) return CMD_ERROR;
|
if (MirrorRoadBits(DiagDirToRoadBits(GetTunnelBridgeDirection(tile))) != pieces) goto do_clear;
|
||||||
if (HasTileRoadType(tile, rt)) return_cmd_error(STR_ERROR_ALREADY_BUILT);
|
if (HasTileRoadType(tile, rt)) return_cmd_error(STR_ERROR_ALREADY_BUILT);
|
||||||
/* Don't allow adding roadtype to the bridge/tunnel when vehicles are already driving on it */
|
/* Don't allow adding roadtype to the bridge/tunnel when vehicles are already driving on it */
|
||||||
if (HasVehicleOnTunnelBridge(tile, GetOtherTunnelBridgeEnd(tile))) return CMD_ERROR;
|
if (HasVehicleOnTunnelBridge(tile, GetOtherTunnelBridgeEnd(tile))) return CMD_ERROR;
|
||||||
|
|
Loading…
Reference in New Issue