summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2019-04-27 19:36:02 +0100
committerPeterN <peter@fuzzle.org>2019-05-04 22:39:29 +0100
commit402e18b460efdb2c1bc4d5623e8019bd913f6db7 (patch)
treebb1e00c458bdc429ec825ae6191aa555c60e6428
parent7ef2f11c4c0191e3300fce60c3fc7fe4a88e6910 (diff)
downloadopenttd-402e18b460efdb2c1bc4d5623e8019bd913f6db7.tar.xz
Change: Allow building road stops over self-owned one-way/blocked road.
-rw-r--r--src/station_cmd.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 1a483d29d..9dbe356e7 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1004,13 +1004,16 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags
if (RoadTypeIsRoad(rt) && !HasPowerOnRoad(rt, road_rt)) return_cmd_error(STR_ERROR_NO_SUITABLE_ROAD);
+ if (GetDisallowedRoadDirections(cur_tile) != DRD_NONE) {
+ CommandCost ret = CheckOwnership(road_owner);
+ if (ret.Failed()) return ret;
+ }
+
cost.AddCost(RoadBuildCost(road_rt) * (2 - num_pieces));
} else if (RoadTypeIsRoad(rt)) {
cost.AddCost(RoadBuildCost(rt) * 2);
}
- if (GetDisallowedRoadDirections(cur_tile) != DRD_NONE) return_cmd_error(STR_ERROR_DRIVE_THROUGH_ON_ONEWAY_ROAD);
-
/* There is a tram, check if we can build road+tram stop over it. */
RoadType tram_rt = GetRoadType(cur_tile, RTT_TRAM);
if (tram_rt != INVALID_ROADTYPE) {