Changeset - r16123:38f1d9712978
[Not reviewed]
master
0 1 0
terkhen - 14 years ago 2010-09-18 20:48:40
terkhen@openttd.org
(svn r20829) -Fix [FS#4094]: Place less trees at once when planting random trees at the scenario editor.
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/tree_cmd.cpp
Show inline comments
 
@@ -53,12 +53,13 @@ enum ExtraTreePlacement {
 

	
 
/** Determines when to consider building more trees. */
 
byte _trees_tick_ctr;
 

	
 
static const uint16 DEFAULT_TREE_STEPS = 1000;             ///< Default number of attempts for placing trees.
 
static const uint16 DEFAULT_RAINFOREST_TREE_STEPS = 15000; ///< Default number of attempts for placing extra trees at rainforest in tropic.
 
static const uint16 EDITOR_TREE_DIV = 5;                   ///< Game editor tree generation divisor factor.
 

	
 
/**
 
 * Tests if a tile can be converted to MP_TREES
 
 * This is true for clear ground without farms or rocks.
 
 *
 
 * @param tile the tile of interest
 
@@ -246,12 +247,13 @@ static void PlaceTreeAtSameHeight(TileIn
 
 */
 
void PlaceTreesRandomly()
 
{
 
	uint i, j, ht;
 

	
 
	i = ScaleByMapSize(DEFAULT_TREE_STEPS);
 
	if (_game_mode == GM_EDITOR) i /= EDITOR_TREE_DIV;
 
	do {
 
		uint32 r = Random();
 
		TileIndex tile = RandomTileSeed(r);
 

	
 
		IncreaseGeneratingWorldProgress(GWP_TREE);
 

	
 
@@ -273,12 +275,13 @@ void PlaceTreesRandomly()
 
		}
 
	} while (--i);
 

	
 
	/* place extra trees at rainforest area */
 
	if (_settings_game.game_creation.landscape == LT_TROPIC) {
 
		i = ScaleByMapSize(DEFAULT_RAINFOREST_TREE_STEPS);
 
		if (_game_mode == GM_EDITOR) i /= EDITOR_TREE_DIV;
 

	
 
		do {
 
			uint32 r = Random();
 
			TileIndex tile = RandomTileSeed(r);
 

	
 
			IncreaseGeneratingWorldProgress(GWP_TREE);
0 comments (0 inline, 0 general)