Skip to content

Commit

Permalink
Add setting for whether water floods from map edges
Browse files Browse the repository at this point in the history
  • Loading branch information
JGRennison committed Sep 28, 2023
1 parent aa4aee1 commit 8a0fab1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/lang/extra/english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,9 @@ STR_CONFIG_SETTING_MIN_CITY_LAND_AREA_HELPTEXT :Cities can only
STR_CONFIG_SETTING_MIN_LAND_AREA_VALUE :{NUM}
STR_CONFIG_SETTING_MIN_LAND_AREA_ZERO :Off

STR_CONFIG_SETTING_FLOOD_FROM_EDGES :Water floods from map edges: {STRING2}
STR_CONFIG_SETTING_FLOOD_FROM_EDGES_HELPTEXT :Whether water floods into edge tiles at sea level from the map edge.

STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE :Adjusted arctic tree placement: {STRING2}
STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE_HELPTEXT :Adjust placement of trees around snow line in artic climate. Trees thin out above snowline. Trees are a mix of arctic and temperate just below snowline. Below that trees are temperate.
STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE_RANGE :Arctic tree range: {STRING2}
Expand Down
1 change: 1 addition & 0 deletions src/settings_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2455,6 +2455,7 @@ static SettingsContainer &GetSettingsTree()
treedist->Add(new SettingEntry("construction.tree_growth_rate"));
}

environment->Add(new SettingEntry("construction.flood_from_edges"));
environment->Add(new SettingEntry("economy.day_length_factor"));
environment->Add(new SettingEntry("station.modified_catchment"));
environment->Add(new SettingEntry("station.catchment_increase"));
Expand Down
1 change: 1 addition & 0 deletions src/settings_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ struct ConstructionSettings {
uint8 raw_industry_construction; ///< type of (raw) industry construction (none, "normal", prospecting)
uint8 industry_platform; ///< the amount of flat land around an industry
bool freeform_edges; ///< allow terraforming the tiles at the map edges
bool flood_from_edges; ///< whether water floods from map edges
uint8 extra_tree_placement; ///< (dis)allow building extra trees in-game
uint8 trees_around_snow_line_range; ///< range around snowline for mixed and arctic forest.
bool trees_around_snow_line_enabled; ///< enable mixed and arctic forest around snowline, and no trees above snowline
Expand Down
8 changes: 8 additions & 0 deletions src/table/settings/settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3951,6 +3951,14 @@ pre_cb = CheckFreeformEdges
post_cb = UpdateFreeformEdges
cat = SC_EXPERT

[SDT_BOOL]
var = construction.flood_from_edges
def = true
str = STR_CONFIG_SETTING_FLOOD_FROM_EDGES
strhelp = STR_CONFIG_SETTING_FLOOD_FROM_EDGES_HELPTEXT
cat = SC_ADVANCED
patxname = ""construction.flood_from_edges""

[SDT_VAR]
var = game_creation.water_borders
type = SLE_UINT8
Expand Down
2 changes: 1 addition & 1 deletion src/water_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ FloodingBehaviour GetFloodingBehaviour(TileIndex tile)
return (GetObjectGroundType(tile) == OBJECT_GROUND_SHORE ? FLOOD_DRYUP : ((GetWaterClass(tile) == WATER_CLASS_SEA) ? FLOOD_ACTIVE : FLOOD_NONE));

case MP_VOID:
return FLOOD_ACTIVE;
return _settings_game.construction.flood_from_edges ? FLOOD_ACTIVE : FLOOD_NONE;

default:
return FLOOD_NONE;
Expand Down

0 comments on commit 8a0fab1

Please sign in to comment.