diff --git a/src/landscape.cpp b/src/landscape.cpp index 7231b024ec..b99d416a04 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -106,7 +106,6 @@ byte _cached_snowline = 0; byte _cached_highest_snowline = 0; byte _cached_lowest_snowline = 0; byte _cached_tree_placement_highest_snowline = 0; -byte _cached_tree_placement_lowest_snowline = 0; /** * Map 2D viewport or smallmap coordinate to 3D world or tile coordinate. @@ -690,9 +689,8 @@ void UpdateCachedSnowLineBounds() _cached_highest_snowline = _snow_line == nullptr ? _settings_game.game_creation.snow_line_height : _snow_line->highest_value; _cached_lowest_snowline = _snow_line == nullptr ? _settings_game.game_creation.snow_line_height : _snow_line->lowest_value; - uint snowline_delta = (((100 - _settings_game.construction.trees_around_snow_line_dynamic_range) * (HighestSnowLine() - LowestSnowLine())) + 50) / 100; - _cached_tree_placement_highest_snowline = HighestSnowLine() - ((snowline_delta + 1) / 2); - _cached_tree_placement_lowest_snowline = LowestSnowLine() + (snowline_delta / 2); + uint snowline_range = ((_settings_game.construction.trees_around_snow_line_dynamic_range * (HighestSnowLine() - LowestSnowLine())) + 50) / 100; + _cached_tree_placement_highest_snowline = LowestSnowLine() + snowline_range; } /** diff --git a/src/landscape.h b/src/landscape.h index 19e3cbc711..84da3c0c6e 100644 --- a/src/landscape.h +++ b/src/landscape.h @@ -59,8 +59,7 @@ inline byte HighestTreePlacementSnowLine() inline byte LowestTreePlacementSnowLine() { - extern byte _cached_tree_placement_lowest_snowline; - return _cached_tree_placement_lowest_snowline; + return LowestSnowLine(); } int GetSlopeZInCorner(Slope tileh, Corner corner); diff --git a/src/lang/english.txt b/src/lang/english.txt index 6957821013..d62ce025bd 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2205,7 +2205,7 @@ STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE_HELPTEXT :Adjust placemen STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE_RANGE :Arctic tree range: {STRING2} STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE_RANGE_HELPTEXT :Approximate range of arctic trees around snow line STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE_DYNAMIC_RANGE :Seasonal snow line width for arctic trees: {STRING2} -STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE_DYNAMIC_RANGE_HELPTEXT :When using a seasonally variable snow line, what percentage of the snow line variation to use as the snow line for arctic tree placement. 0% uses the mid-point between summer and winter snow lines, 100% uses the whole range between the summer and winter snow lines. +STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE_DYNAMIC_RANGE_HELPTEXT :When using a seasonally variable snow line, what percentage of the snow line variation to use as the snow line for arctic tree placement. 0% uses the lower (winter) snow line, 100% uses the whole range between the summer and winter snow lines. STR_CONFIG_SETTING_BUILD_PUBLIC_ROADS :Build public roads connecting towns: {STRING2} STR_CONFIG_SETTING_BUILD_PUBLIC_ROADS_HELPTEXT :Generates public roads which connect the towns. Takes a bit of time on bigger maps. 'Build and avoid' generates roads which avoid curves and result in very grid-like connections.