summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_road.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai/api/ai_road.cpp')
-rw-r--r--src/ai/api/ai_road.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/ai/api/ai_road.cpp b/src/ai/api/ai_road.cpp
index 7c6663157..784ca69b7 100644
--- a/src/ai/api/ai_road.cpp
+++ b/src/ai/api/ai_road.cpp
@@ -193,21 +193,9 @@ static RoadBits NeighbourToRoadBits(int32 neighbour)
*/
static int32 LookupWithBuildOnSlopes(::Slope slope, Array *existing, int32 start, int32 end)
{
- if (::IsSteepSlope(slope)) {
- switch (slope) {
- /* On steep slopes one can only build straight roads that will be
- * automatically expanded to a straight road. Just check that the existing
- * road parts are in the same direction. */
- case SLOPE_STEEP_S:
- case SLOPE_STEEP_W:
- case SLOPE_STEEP_N:
- case SLOPE_STEEP_E:
- return CheckAutoExpandedRoadBits(existing, start, end) ? (existing->size == 0 ? 2 : 1) : 0;
-
- /* All other slopes are invalid slopes!. */
- default:
- return -1;
- }
+ /* Steep slopes behave the same as slopes with one corner raised. */
+ if (IsSteepSlope(slope)) {
+ slope = SlopeWithOneCornerRaised(GetHighestSlopeCorner(slope));
}
/* The slope is not steep. Furthermore lots of slopes are generally the