summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-04-07 07:39:03 +0000
committercelestar <celestar@openttd.org>2006-04-07 07:39:03 +0000
commit48b69f13442f2e94be19209a518083ed1daa05bb (patch)
tree0a4650e1601301e1fea5c0e83ec2f36618702397
parentcc51832917f377fccda4f1e7fa046e6b318067c7 (diff)
downloadopenttd-48b69f13442f2e94be19209a518083ed1daa05bb.tar.xz
(svn r4306) -Fix (103). Assertion when removing elrails under bridges. Thanks to Rubidium for reporting and fixing
-rw-r--r--elrail.c11
1 files 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);