From f2cb8b8bd616c61ddf1b0e84211493a8bc904ebf Mon Sep 17 00:00:00 2001 From: celestar Date: Fri, 7 Apr 2006 07:39:03 +0000 Subject: (svn r4306) -Fix (103). Assertion when removing elrails under bridges. Thanks to Rubidium for reporting and fixing --- elrail.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/elrail.c b/elrail.c index 8a1256f2d..f56e03dd6 100644 --- a/elrail.c +++ b/elrail.c @@ -91,11 +91,12 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override) return DiagDirToAxis(GetTunnelDirection(t)) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y; } else { if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0; - if ( - IsBridgeMiddle(t) && - IsTransportUnderBridge(t) && - GetTransportTypeUnderBridge(t) == TRANSPORT_RAIL) { - return GetRailBitsUnderBridge(t); + if (IsBridgeMiddle(t)) { + if (IsTransportUnderBridge(t) && + GetTransportTypeUnderBridge(t) == TRANSPORT_RAIL) { + return GetRailBitsUnderBridge(t); + } else + return 0; } else { if (override != NULL && DistanceMax(t, GetOtherBridgeEnd(t)) > 1) *override = 1 << GetBridgeRampDirection(t); -- cgit v1.2.3-70-g09d2