(svn r4165) -Do not use GetBridgeAxis on bridge ramps (request by Tron)
authorcelestar
Thu, 30 Mar 2006 09:26:17 +0000
changeset 3368 57034dcd7978
parent 3367 3f82c99d42af
child 3369 00c2ca209a89
(svn r4165) -Do not use GetBridgeAxis on bridge ramps (request by Tron)
elrail.c
--- a/elrail.c	Thu Mar 30 09:08:43 2006 +0000
+++ b/elrail.c	Thu Mar 30 09:26:17 2006 +0000
@@ -95,7 +95,7 @@
 				} else {
 					if (override != NULL && DistanceMax(t, GetOtherBridgeEnd(t)) > 1) *override = 1 << GetBridgeRampDirection(t);
 
-					return GetBridgeAxis(t) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y;
+					return DiagDirToAxis(GetBridgeRampDirection(t)) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y;
 				}
 			}
 		case MP_STREET:
@@ -196,7 +196,10 @@
 
 		/* Read the foundataions if they are present, and adjust the tileh */
 		if (IsTileType(neighbour, MP_RAILWAY)) foundation = GetRailFoundation(tileh[TS_NEIGHBOUR], trackconfig[TS_NEIGHBOUR]);
-		if (IsBridgeTile(neighbour) && IsBridgeRamp(neighbour)) foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], GetBridgeAxis(neighbour));
+		if (IsBridgeTile(neighbour) && IsBridgeRamp(neighbour)) {
+			foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetBridgeRampDirection(neighbour)));
+		}
+
 		if (foundation != 0) {
 			if (foundation < 15) {
 				tileh[TS_NEIGHBOUR] = 0;