diff options
author | SamuXarick <43006711+SamuXarick@users.noreply.github.com> | 2019-02-28 17:45:17 +0000 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-02-28 17:45:17 +0000 |
commit | 50a0cf19158a1a1fda628a64e3ea490c9d06c42c (patch) | |
tree | 55526823f11bdd82faf71ae46e28e7aef3a59912 /src | |
parent | 03264059e43c7f8806a565e4d0db9036706b1fc1 (diff) | |
download | openttd-50a0cf19158a1a1fda628a64e3ea490c9d06c42c.tar.xz |
Change: Allow towns to build bridges over rails and one-way roads. (#7291)
Diffstat (limited to 'src')
-rw-r--r-- | src/town_cmd.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index dacf59ddc..84c7d44f3 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1080,14 +1080,14 @@ static bool GrowTownWithBridge(const Town *t, const TileIndex tile, const DiagDi const int delta = TileOffsByDiagDir(bridge_dir); if (slope == SLOPE_FLAT) { - /* Bridges starting on flat tiles are only allowed when crossing rivers. */ + /* Bridges starting on flat tiles are only allowed when crossing rivers, rails or one-way roads. */ do { if (bridge_length++ >= 4) { - /* Allow to cross rivers, not big lakes. */ + /* Allow to cross rivers, not big lakes, nor large amounts of rails or one-way roads. */ return false; } bridge_tile += delta; - } while (IsValidTile(bridge_tile) && IsWaterTile(bridge_tile) && !IsSea(bridge_tile)); + } while (IsValidTile(bridge_tile) && ((IsWaterTile(bridge_tile) && !IsSea(bridge_tile)) || IsPlainRailTile(bridge_tile) || (IsNormalRoadTile(bridge_tile) && GetDisallowedRoadDirections(bridge_tile) != DRD_NONE))); } else { do { if (bridge_length++ >= 11) { @@ -1095,7 +1095,7 @@ static bool GrowTownWithBridge(const Town *t, const TileIndex tile, const DiagDi return false; } bridge_tile += delta; - } while (IsValidTile(bridge_tile) && IsWaterTile(bridge_tile)); + } while (IsValidTile(bridge_tile) && (IsWaterTile(bridge_tile) || IsPlainRailTile(bridge_tile) || (IsNormalRoadTile(bridge_tile) && GetDisallowedRoadDirections(bridge_tile) != DRD_NONE))); } /* no water tiles in between? */ |