summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-09-18 20:44:13 +0000
committerterkhen <terkhen@openttd.org>2010-09-18 20:44:13 +0000
commitee8272bacc5e6e21de33188d98169e932b76d1e6 (patch)
tree4017f1d7f00411a9da3bdac2ebafbc43b329876c
parent95e5e59f37b479f280623a4c98a8bc470460670c (diff)
downloadopenttd-ee8272bacc5e6e21de33188d98169e932b76d1e6.tar.xz
(svn r20828) -Add: Take into account tree group placement at the world generation progress bar.
-rw-r--r--src/tree_cmd.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index 5572a0f96..31d114258 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -196,6 +196,8 @@ static void PlaceTreeGroups(uint num_groups)
uint dist = abs(x) + abs(y);
TileIndex cur_tile = TileAddWrap(center_tile, x, y);
+ IncreaseGeneratingWorldProgress(GWP_TREE);
+
if (cur_tile != INVALID_TILE && dist <= 13 && CanPlantTreesOnTile(cur_tile, true)) {
PlaceTree(cur_tile, r);
}
@@ -300,8 +302,6 @@ void GenerateTrees()
if (_settings_game.game_creation.tree_placer == TP_NONE) return;
- if (_settings_game.game_creation.landscape != LT_TOYLAND) PlaceTreeGroups(ScaleByMapSize(GB(Random(), 0, 5) + 25));
-
switch (_settings_game.game_creation.tree_placer) {
case TP_ORIGINAL: i = _settings_game.game_creation.landscape == LT_ARCTIC ? 15 : 6; break;
case TP_IMPROVED: i = _settings_game.game_creation.landscape == LT_ARCTIC ? 4 : 2; break;
@@ -311,8 +311,12 @@ void GenerateTrees()
total = ScaleByMapSize(DEFAULT_TREE_STEPS);
if (_settings_game.game_creation.landscape == LT_TROPIC) total += ScaleByMapSize(DEFAULT_RAINFOREST_TREE_STEPS);
total *= i;
+ uint num_groups = (_settings_game.game_creation.landscape != LT_TOYLAND) ? ScaleByMapSize(GB(Random(), 0, 5) + 25) : 0;
+ total += num_groups * DEFAULT_TREE_STEPS;
SetGeneratingWorldProgress(GWP_TREE, total);
+ if (num_groups != 0) PlaceTreeGroups(num_groups);
+
for (; i != 0; i--) {
PlaceTreesRandomly();
}