summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-03-31 19:01:57 +0000
committercelestar <celestar@openttd.org>2006-03-31 19:01:57 +0000
commit1f88ea4ec64f7dc8153dff3a8ca0ce20e7789a68 (patch)
tree8465f97b55b99c9650b3122e4eb18e7b86c61826
parent736983a06ddc3fb61727e7ff371963ae7f70ff92 (diff)
downloadopenttd-1f88ea4ec64f7dc8153dff3a8ca0ce20e7789a68.tar.xz
(svn r4214) -Fix: Do not try to obtain Trackbits for normal rails, bus stops, airports and other non-rail tiles
-rw-r--r--elrail.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/elrail.c b/elrail.c
index 2f4671141..4d6d6eedc 100644
--- a/elrail.c
+++ b/elrail.c
@@ -101,9 +101,11 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override)
}
}
case MP_STREET:
+ if (!GetRoadType(t) == ROAD_CROSSING) return 0;
if (GetRailTypeCrossing(t) != RAILTYPE_ELECTRIC) return 0;
return GetCrossingRailBits(t);
case MP_STATION:
+ if (!IsRailwayStation(t)) return 0;
if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
return TrackToTrackBits(GetRailStationTrack(t));
default: