From 0116a422ea55e883d0ad8b44432bac4085071066 Mon Sep 17 00:00:00 2001 From: 2TallTyler Date: Tue, 13 Dec 2022 13:36:32 -0500 Subject: [PATCH] Cleanup: Refactor Wide Rivers code slightly --- src/landscape.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/landscape.cpp b/src/landscape.cpp index 1aadfb3731..6fbd0c00af 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -1176,9 +1176,9 @@ static bool RiverMakeWider(TileIndex tile, void *data) Command::Do(DC_EXEC | DC_AUTO, tile, to_change, true); } } + /* Update cur_slope after possibly terraforming. */ + cur_slope = GetTileSlope(tile); } - /* Update cur_slope after possibly terraforming. */ - cur_slope = GetTileSlope(tile); /* Sloped rivers need water both upstream and downstream. */ if (IsInclinedSlope(cur_slope)) { @@ -1319,7 +1319,7 @@ static void River_FoundEndNode(AyStar *aystar, OpenListNode *current) current_river_length = DistanceManhattan(data->spring, tile); radius = std::min(3u, (current_river_length / (long_river_length / 3u)) + 1u); - if (radius > 1) CircularTileSearch(&tile, radius + RandomRange(1), RiverMakeWider, (void *)&path->node.tile); + if (radius > 1) CircularTileSearch(&tile, radius, RiverMakeWider, (void *)&path->node.tile); } } }