Mercurial > hg > openttd
changeset 3462:fed34c0d3276 draft
(svn r4306) -Fix (103). Assertion when removing elrails under bridges. Thanks to Rubidium for reporting and fixing
author | celestar <celestar@openttd.org> |
---|---|
date | Fri, 07 Apr 2006 07:39:03 +0000 |
parents | ae7e5e7139c6 |
children | 0ff21e79cd9b |
files | elrail.c |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/elrail.c +++ b/elrail.c @@ -91,11 +91,12 @@ 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);