diff options
author | alberth <alberth@openttd.org> | 2015-05-16 12:01:19 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2015-05-16 12:01:19 +0000 |
commit | b8414c28844e3df865b77b494aa200b5957cb826 (patch) | |
tree | 5233b0a1bccd484c4bfe648546b70256f6cdd5cc /src | |
parent | c13b8aa2cb3b9b021c0d5bf649e22f59b84193ef (diff) | |
download | openttd-b8414c28844e3df865b77b494aa200b5957cb826.tar.xz |
(svn r27285) -Codechange: Use LG_ORIGINAL instead of a magic 0 to indicate the original landscape generator.
Diffstat (limited to 'src')
-rw-r--r-- | src/genworld_gui.cpp | 14 | ||||
-rw-r--r-- | src/settings.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 1e9485b5f..ad64ae802 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -403,10 +403,10 @@ struct GenerateLandscapeWindow : public Window { /* You can't select smoothness / non-water borders if not terragenesis */ if (mode == GLWM_GENERATE) { - this->SetWidgetDisabledState(WID_GL_SMOOTHNESS_PULLDOWN, _settings_newgame.game_creation.land_generator == 0); - this->SetWidgetDisabledState(WID_GL_VARIETY_PULLDOWN, _settings_newgame.game_creation.land_generator == 0); - this->SetWidgetDisabledState(WID_GL_BORDERS_RANDOM, _settings_newgame.game_creation.land_generator == 0 || !_settings_newgame.construction.freeform_edges); - this->SetWidgetsDisabledState(_settings_newgame.game_creation.land_generator == 0 || !_settings_newgame.construction.freeform_edges || _settings_newgame.game_creation.water_borders == BORDERS_RANDOM, + this->SetWidgetDisabledState(WID_GL_SMOOTHNESS_PULLDOWN, _settings_newgame.game_creation.land_generator == LG_ORIGINAL); + this->SetWidgetDisabledState(WID_GL_VARIETY_PULLDOWN, _settings_newgame.game_creation.land_generator == LG_ORIGINAL); + this->SetWidgetDisabledState(WID_GL_BORDERS_RANDOM, _settings_newgame.game_creation.land_generator == LG_ORIGINAL || !_settings_newgame.construction.freeform_edges); + this->SetWidgetsDisabledState(_settings_newgame.game_creation.land_generator == LG_ORIGINAL || !_settings_newgame.construction.freeform_edges || _settings_newgame.game_creation.water_borders == BORDERS_RANDOM, WID_GL_WATER_NW, WID_GL_WATER_NE, WID_GL_WATER_SE, WID_GL_WATER_SW, WIDGET_LIST_END); this->SetWidgetLoweredState(WID_GL_BORDERS_RANDOM, _settings_newgame.game_creation.water_borders == BORDERS_RANDOM); @@ -416,7 +416,7 @@ struct GenerateLandscapeWindow : public Window { this->SetWidgetLoweredState(WID_GL_WATER_SE, HasBit(_settings_newgame.game_creation.water_borders, BORDER_SE)); this->SetWidgetLoweredState(WID_GL_WATER_SW, HasBit(_settings_newgame.game_creation.water_borders, BORDER_SW)); - this->SetWidgetsDisabledState(_settings_newgame.game_creation.land_generator == 0 && (_settings_newgame.game_creation.landscape == LT_ARCTIC || _settings_newgame.game_creation.landscape == LT_TROPIC), + this->SetWidgetsDisabledState(_settings_newgame.game_creation.land_generator == LG_ORIGINAL && (_settings_newgame.game_creation.landscape == LT_ARCTIC || _settings_newgame.game_creation.landscape == LT_TROPIC), WID_GL_TERRAIN_PULLDOWN, WID_GL_WATER_PULLDOWN, WIDGET_LIST_END); } @@ -432,7 +432,7 @@ struct GenerateLandscapeWindow : public Window { this->SetWidgetDisabledState(WID_GL_SNOW_LEVEL_UP, _settings_newgame.game_creation.snow_line_height >= MAX_SNOWLINE_HEIGHT || _settings_newgame.game_creation.landscape != LT_ARCTIC); /* Do not allow a custom sea level with the original land generator. */ - if (_settings_newgame.game_creation.land_generator == 0 && + if (_settings_newgame.game_creation.land_generator == LG_ORIGINAL && _settings_newgame.difficulty.quantity_sea_lakes == CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY) { _settings_newgame.difficulty.quantity_sea_lakes = CUSTOM_SEA_LEVEL_MIN_PERCENTAGE; } @@ -655,7 +655,7 @@ struct GenerateLandscapeWindow : public Window { case WID_GL_WATER_PULLDOWN: { // Water quantity uint32 hidden_mask = 0; /* Disable custom water level when the original map generator is active. */ - if (_settings_newgame.game_creation.land_generator == 0) { + if (_settings_newgame.game_creation.land_generator == LG_ORIGINAL) { SetBit(hidden_mask, CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY); } ShowDropDownMenu(this, _sea_lakes, _settings_newgame.difficulty.quantity_sea_lakes, WID_GL_WATER_PULLDOWN, 0, hidden_mask); diff --git a/src/settings.cpp b/src/settings.cpp index ecad0239c..e6754bb90 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1147,7 +1147,7 @@ static bool InvalidateCompanyWindow(int32 p1) static void ValidateSettings() { /* Do not allow a custom sea level with the original land generator. */ - if (_settings_newgame.game_creation.land_generator == 0 && + if (_settings_newgame.game_creation.land_generator == LG_ORIGINAL && _settings_newgame.difficulty.quantity_sea_lakes == CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY) { _settings_newgame.difficulty.quantity_sea_lakes = CUSTOM_SEA_LEVEL_MIN_PERCENTAGE; } |