Merge branch 'master' into jgrpp-beta

# Conflicts:
#	src/lang/chuvash.txt
#	src/lang/czech.txt
#	src/lang/english_AU.txt
#	src/lang/english_US.txt
#	src/lang/german.txt
#	src/lang/japanese.txt
#	src/lang/korean.txt
#	src/lang/latvian.txt
#	src/lang/russian.txt
#	src/tree_gui.cpp
#	src/vehicle.cpp
This commit is contained in:
Jonathan G Rennison
2021-11-02 21:11:11 +00:00
84 changed files with 28242 additions and 8014 deletions

View File

@@ -449,9 +449,10 @@ void RemoveAllTrees()
* @param treetype Type of trees to place. Must be a valid tree type for the climate.
* @param radius Maximum distance (on each axis) from tile to place trees.
* @param count Maximum number of trees to place.
* @param set_zone Whether to create a rainforest zone when placing rainforest trees.
* @return Number of trees actually placed.
*/
uint PlaceTreeGroupAroundTile(TileIndex tile, TreeType treetype, uint radius, uint count)
uint PlaceTreeGroupAroundTile(TileIndex tile, TreeType treetype, uint radius, uint count, bool set_zone)
{
assert(treetype < TREE_TOYLAND + TREE_COUNT_TOYLAND);
const bool allow_desert = treetype == TREE_CACTUS;
@@ -482,6 +483,12 @@ uint PlaceTreeGroupAroundTile(TileIndex tile, TreeType treetype, uint radius, ui
}
}
if (set_zone && IsInsideMM(treetype, TREE_RAINFOREST, TREE_CACTUS)) {
for (TileIndex t : TileArea(tile).Expand(radius)) {
if (GetTileType(t) != MP_VOID && DistanceSquare(tile, t) < radius * radius) SetTropicZone(t, TROPICZONE_RAINFOREST);
}
}
return planted;
}