src/elrail.cpp
changeset 7335 141c6b86ec1f
parent 7333 e48228e44be8
child 7370 41adc721b1fa
--- a/src/elrail.cpp	Thu Jul 26 15:37:19 2007 +0000
+++ b/src/elrail.cpp	Thu Jul 26 16:51:10 2007 +0000
@@ -176,7 +176,7 @@
 
 	for (i = DIAGDIR_NE; i < DIAGDIR_END; i++) {
 		TileIndex neighbour = ti->tile + TileOffsByDiagDir(i);
-		uint foundation = 0;
+		Foundation foundation = FOUNDATION_NONE;
 		int k;
 
 		/* Here's one of the main headaches. GetTileSlope does not correct for possibly
@@ -225,9 +225,7 @@
 			foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetBridgeRampDirection(neighbour)));
 		}
 
-		if (foundation != 0) {
-			tileh[TS_NEIGHBOUR] = foundation < 15 ? SLOPE_FLAT : _inclined_tileh[foundation - 15];
-		}
+		ApplyFoundationToSlope(foundation, &tileh[TS_NEIGHBOUR]);
 
 		AdjustTileh(neighbour, &tileh[TS_NEIGHBOUR]);