summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Trahan <tyler@tylertrahan.com>2021-01-08 12:56:39 -0500
committerGitHub <noreply@github.com>2021-01-08 18:56:39 +0100
commitb08c66a796c8f9d1430201717fc6b5f0cc31f7c7 (patch)
tree6b26d4d3050e2df9453164b4c60f1abe469dcd82
parent9c0da686da260962c68a6a0ec58fe10cbf4dc421 (diff)
downloadopenttd-b08c66a796c8f9d1430201717fc6b5f0cc31f7c7.tar.xz
Fix 7bdfb38: Drive-thru road stations can be connected at either end (#8528)
-rw-r--r--src/town_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 3ea1ce436..3a2cd7087 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1112,6 +1112,7 @@ static bool GrowTownWithRoad(const Town *t, TileIndex tile, RoadBits rcmd)
* Checks if a town road can be continued into the next tile.
* Road vehicle stations, bridges, and tunnels are fine, as long as they are facing the right direction.
*
+ * @param t The current town
* @param tile The tile where the road would be built
* @param road_dir The direction of the road
* @return true if the road can be continued, else false
@@ -1133,8 +1134,8 @@ static bool CanRoadContinueIntoNextTile(const Town* t, const TileIndex tile, con
/* If the next tile is a station, allow if it's a road station facing the proper direction. Otherwise return false. */
if (IsTileType(next_tile, MP_STATION)) {
- /* If the next tile is a road station, allow if it's facing the same direction, otherwise disallow. */
- return IsRoadStop(next_tile) && GetRoadStopDir(next_tile) == ReverseDiagDir(road_dir);
+ /* If the next tile is a road station, allow if it can be entered by the new tunnel/bridge, otherwise disallow. */
+ return IsRoadStop(next_tile) && (GetRoadStopDir(next_tile) == ReverseDiagDir(road_dir) || (IsDriveThroughStopTile(next_tile) && GetRoadStopDir(next_tile) == road_dir));
}
/* If the next tile is a road depot, allow if it's facing the right way. */