summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2012-12-21 18:51:10 +0000
committermichi_cc <michi_cc@openttd.org>2012-12-21 18:51:10 +0000
commit0d331c8d8e52a47bbc6a3d0ef31c291f325724ad (patch)
tree7b1e24332eee400e15f484c7b7d138d0eb6d7510 /src
parentcf570106a6f394fe9e4e54e646ca36b0b1f94eb4 (diff)
downloadopenttd-0d331c8d8e52a47bbc6a3d0ef31c291f325724ad.tar.xz
(svn r24837) -Fix: Don't consider blocked rail station tiles that display wires as non-reachable for masking out unnecessary catenary wires.
Diffstat (limited to 'src')
-rw-r--r--src/elrail.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp
index 2a0a68de3..3ef3fab84 100644
--- a/src/elrail.cpp
+++ b/src/elrail.cpp
@@ -129,9 +129,13 @@ static TrackBits MaskWireBits(TileIndex t, TrackBits tracks)
for (DiagDirection d = DIAGDIR_BEGIN; d < DIAGDIR_END; d++) {
/* If the neighbor tile is either not electrified or has no tracks that can be reached
* from this tile, mark all trackdirs that can be reached from the neighbour tile
- * as needing no catenary. */
- RailType rt = GetTileRailType(TileAddByDiagDir(t, d));
- if (rt == INVALID_RAILTYPE || !HasCatenary(rt) || (TrackStatusToTrackBits(GetTileTrackStatus(TileAddByDiagDir(t, d), TRANSPORT_RAIL, 0)) & DiagdirReachesTracks(d)) == TRACK_BIT_NONE) {
+ * as needing no catenary. We make an exception for blocked station tiles with a matching
+ * axis that still display wires to preserve visual continuity. */
+ TileIndex next_tile = TileAddByDiagDir(t, d);
+ RailType rt = GetTileRailType(next_tile);
+ if (rt == INVALID_RAILTYPE || !HasCatenary(rt) ||
+ ((TrackStatusToTrackBits(GetTileTrackStatus(next_tile, TRANSPORT_RAIL, 0)) & DiagdirReachesTracks(d)) == TRACK_BIT_NONE &&
+ (!HasStationTileRail(next_tile) || GetRailStationAxis(next_tile) != DiagDirToAxis(d) || !CanStationTileHaveWires(next_tile)))) {
neighbour_tdb |= DiagdirReachesTrackdirs(ReverseDiagDir(d));
}
}