src/tree_cmd.cpp
changeset 9354 845e07db4549
parent 9322 cf7dc39f9576
child 9358 2e1e4d2f71dd
equal deleted inserted replaced
9353:9d76aef9fe2b 9354:845e07db4549
   247 
   247 
   248 		IncreaseGeneratingWorldProgress(GWP_TREE);
   248 		IncreaseGeneratingWorldProgress(GWP_TREE);
   249 
   249 
   250 		if (CanPlantTreesOnTile(tile, true)) {
   250 		if (CanPlantTreesOnTile(tile, true)) {
   251 			PlaceTree(tile, r);
   251 			PlaceTree(tile, r);
   252 			if (_patches.tree_placer != TP_IMPROVED) continue;
   252 			if (_settings.game_creation.tree_placer != TP_IMPROVED) continue;
   253 
   253 
   254 			/* Place a number of trees based on the tile height.
   254 			/* Place a number of trees based on the tile height.
   255 			 *  This gives a cool effect of multiple trees close together.
   255 			 *  This gives a cool effect of multiple trees close together.
   256 			 *  It is almost real life ;) */
   256 			 *  It is almost real life ;) */
   257 			ht = GetTileZ(tile);
   257 			ht = GetTileZ(tile);
   294  */
   294  */
   295 void GenerateTrees()
   295 void GenerateTrees()
   296 {
   296 {
   297 	uint i, total;
   297 	uint i, total;
   298 
   298 
   299 	if (_patches.tree_placer == TP_NONE) return;
   299 	if (_settings.game_creation.tree_placer == TP_NONE) return;
   300 
   300 
   301 	if (_opt.landscape != LT_TOYLAND) PlaceMoreTrees();
   301 	if (_opt.landscape != LT_TOYLAND) PlaceMoreTrees();
   302 
   302 
   303 	switch (_patches.tree_placer) {
   303 	switch (_settings.game_creation.tree_placer) {
   304 		case TP_ORIGINAL: i = _opt.landscape == LT_ARCTIC ? 15 : 6; break;
   304 		case TP_ORIGINAL: i = _opt.landscape == LT_ARCTIC ? 15 : 6; break;
   305 		case TP_IMPROVED: i = _opt.landscape == LT_ARCTIC ?  4 : 2; break;
   305 		case TP_IMPROVED: i = _opt.landscape == LT_ARCTIC ?  4 : 2; break;
   306 		default: NOT_REACHED(); return;
   306 		default: NOT_REACHED(); return;
   307 	}
   307 	}
   308 
   308 
   388 							default: break;
   388 							default: break;
   389 						}
   389 						}
   390 					}
   390 					}
   391 
   391 
   392 					if (_game_mode != GM_EDITOR && IsValidPlayer(_current_player)) {
   392 					if (_game_mode != GM_EDITOR && IsValidPlayer(_current_player)) {
   393 						Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority);
   393 						Town *t = ClosestTownFromTile(tile, _settings.economy.dist_local_authority);
   394 						if (t != NULL) ChangeTownRating(t, RATING_TREE_UP_STEP, RATING_TREE_MAXIMUM);
   394 						if (t != NULL) ChangeTownRating(t, RATING_TREE_UP_STEP, RATING_TREE_MAXIMUM);
   395 					}
   395 					}
   396 
   396 
   397 					if (flags & DC_EXEC) {
   397 					if (flags & DC_EXEC) {
   398 						TreeType treetype;
   398 						TreeType treetype;
   531 static CommandCost ClearTile_Trees(TileIndex tile, byte flags)
   531 static CommandCost ClearTile_Trees(TileIndex tile, byte flags)
   532 {
   532 {
   533 	uint num;
   533 	uint num;
   534 
   534 
   535 	if (IsValidPlayer(_current_player)) {
   535 	if (IsValidPlayer(_current_player)) {
   536 		Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority);
   536 		Town *t = ClosestTownFromTile(tile, _settings.economy.dist_local_authority);
   537 		if (t != NULL) ChangeTownRating(t, RATING_TREE_DOWN_STEP, RATING_TREE_MINIMUM);
   537 		if (t != NULL) ChangeTownRating(t, RATING_TREE_DOWN_STEP, RATING_TREE_MINIMUM);
   538 	}
   538 	}
   539 
   539 
   540 	num = GetTreeCount(tile) + 1;
   540 	num = GetTreeCount(tile) + 1;
   541 	if (IsInsideMM(GetTreeType(tile), TREE_RAINFOREST, TREE_CACTUS)) num *= 4;
   541 	if (IsInsideMM(GetTreeType(tile), TREE_RAINFOREST, TREE_CACTUS)) num *= 4;