(svn r7647) [cbh] - Fix: Draw catenary on custombridgeheads properly custombridgeheads
authorcelestar
Sat, 30 Dec 2006 12:59:17 +0000
branchcustombridgeheads
changeset 5602 de5228fb1871
parent 5601 51f241d43769
child 5603 f3aa14b91b0a
(svn r7647) [cbh] - Fix: Draw catenary on custombridgeheads properly
elrail.c
--- a/elrail.c	Sat Dec 30 12:55:45 2006 +0000
+++ b/elrail.c	Sat Dec 30 12:59:17 2006 +0000
@@ -98,7 +98,7 @@
 			if (override != NULL && DistanceMax(t, GetOtherBridgeEnd(t)) > 1) {
 				*override = 1 << GetBridgeRampDirection(t);
 			}
-			return AxisToTrackBits(DiagDirToAxis(GetBridgeRampDirection(t)));
+			return GetTrackBits(t);
 
 		case MP_STREET:
 			if (GetRoadTileType(t) != ROAD_TILE_CROSSING) return 0;
@@ -125,6 +125,10 @@
 	if (IsTileType(tile, MP_TUNNEL)) *tileh = SLOPE_FLAT;
 
 	if (IsTileType(tile, MP_RAILWAY_BRIDGE)) {
+		if (GetTrackBits(tile) != TRACK_BIT_X && GetTrackBits(tile) != TRACK_BIT_Y) {
+			*tileh = SLOPE_FLAT;
+			return;
+		}
 		if (*tileh != SLOPE_FLAT) {
 			*tileh = SLOPE_FLAT;
 		} else {