src/bridge_map.cpp
changeset 8260 c7d75cebe3f6
parent 7832 2f84cd6d6c28
child 6872 1c4a4a609f85
--- a/src/bridge_map.cpp	Sat Oct 20 14:51:09 2007 +0000
+++ b/src/bridge_map.cpp	Sat Oct 20 16:50:48 2007 +0000
@@ -7,6 +7,7 @@
 #include "bridge_map.h"
 #include "bridge.h"
 #include "variables.h"
+#include "landscape.h"
 
 
 TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
@@ -46,9 +47,6 @@
 	Slope tileh = GetTileSlope(t, &h);
 	Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetBridgeRampDirection(t)));
 
-	/* one height level extra if the ramp is on a flat foundation */
-	return
-		h + TILE_HEIGHT +
-		(IsLeveledFoundation(f) ? TILE_HEIGHT : 0) +
-		(IsSteepSlope(tileh) ? TILE_HEIGHT : 0);
+	/* one height level extra for the ramp */
+	return h + TILE_HEIGHT + ApplyFoundationToSlope(f, &tileh);
 }