summaryrefslogtreecommitdiff
path: root/src/landscape.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-08-20 20:07:02 +0000
committermichi_cc <michi_cc@openttd.org>2011-08-20 20:07:02 +0000
commit4261e8fdfd2c8958fc3cc22e57baa90361051b65 (patch)
tree5581d098bba7d0fa9d21fae1d9a34e81d698d69e /src/landscape.cpp
parentd7baf7a4a9704fe0b797624e3d1e4a2053101aea (diff)
downloadopenttd-4261e8fdfd2c8958fc3cc22e57baa90361051b65.tar.xz
(svn r22773) -Add: Some grass around rivers in desert areas.
Diffstat (limited to 'src/landscape.cpp')
-rw-r--r--src/landscape.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp
index 35a00e1d2..adc510253 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -1038,7 +1038,12 @@ static void River_GetNeighbours(AyStar *aystar, OpenListNode *current)
static void River_FoundEndNode(AyStar *aystar, OpenListNode *current)
{
for (PathNode *path = &current->path; path != NULL; path = path->parent) {
- if (!IsWaterTile(path->node.tile)) MakeRiver(path->node.tile, Random());
+ TileIndex tile = path->node.tile;
+ if (!IsWaterTile(tile)) {
+ MakeRiver(tile, Random());
+ /* Remove desert directly around the river tile. */
+ CircularTileSearch(&tile, 5, RiverModifyDesertZone, NULL);
+ }
}
}
@@ -1168,7 +1173,7 @@ static void CreateRivers()
if (amount == 0) return;
uint wells = ScaleByMapSize(4 << _settings_game.game_creation.amount_of_rivers);
- SetGeneratingWorldProgress(GWP_RIVER, wells);
+ SetGeneratingWorldProgress(GWP_RIVER, wells + 256 / 64); // Include the tile loop calls below.
bool *marks = CallocT<bool>(MapSize());
for (; wells != 0; wells--) {
@@ -1181,6 +1186,12 @@ static void CreateRivers()
}
free(marks);
+
+ /* Run tile loop to update the ground density. */
+ for (uint i = 0; i != 256; i++) {
+ if (i % 64 == 0) IncreaseGeneratingWorldProgress(GWP_RIVER);
+ RunTileLoop();
+ }
}
void GenerateLandscape(byte mode)