diff options
Diffstat (limited to 'src/yapf')
-rw-r--r-- | src/yapf/yapf_costrail.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/yapf/yapf_costrail.hpp b/src/yapf/yapf_costrail.hpp index 81ef6a82a..a622d2671 100644 --- a/src/yapf/yapf_costrail.hpp +++ b/src/yapf/yapf_costrail.hpp @@ -111,7 +111,7 @@ public: FORCEINLINE int SwitchCost(TileIndex tile1, TileIndex tile2, DiagDirection exitdir) { - if (IsTileType(tile1, MP_RAILWAY) && IsTileType(tile2, MP_RAILWAY)) { + if (IsTileType(tile1, MP_RAILWAY) && IsTileType(tile2, MP_RAILWAY) && IsPlainRailTile(tile1) && IsPlainRailTile(tile2)) { bool t1 = KillFirstBit(GetTrackBits(tile1) & DiagdirReachesTracks(ReverseDiagDir(exitdir))) != TRACK_BIT_NONE; bool t2 = KillFirstBit(GetTrackBits(tile2) & DiagdirReachesTracks(exitdir)) != TRACK_BIT_NONE; if (t1 && t2) return Yapf().PfGetSettings().rail_doubleslip_penalty; |