From 804090b317aad7c53a59ef68a40dd913f4618c95 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 1 Oct 2011 16:45:25 +0000 Subject: (svn r22968) -Feature: Allow road corners on steep slopes. --- src/ai/api/ai_road.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/ai') 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 -- cgit v1.2.3-70-g09d2