Changeset - r21781:e4afa7ae39c1
[Not reviewed]
master
0 1 0
rubidium - 10 years ago 2014-09-27 09:53:48
rubidium@openttd.org
(svn r26926) -Change: limit flat world height to the maximum configured map height
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/genworld_gui.cpp
Show inline comments
 
@@ -991,13 +991,13 @@ struct CreateScenarioWindow : public Win
 
			case WID_CS_FLAT_LAND_HEIGHT_UP: // Height level buttons
 
				/* Don't allow too fast scrolling */
 
				if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
 
					this->HandleButtonClick(widget);
 
					this->SetDirty();
 

	
 
					_settings_newgame.game_creation.se_flat_world_height = Clamp(_settings_newgame.game_creation.se_flat_world_height + widget - WID_CS_FLAT_LAND_HEIGHT_TEXT, 0, MAX_TILE_HEIGHT);
 
					_settings_newgame.game_creation.se_flat_world_height = Clamp(_settings_newgame.game_creation.se_flat_world_height + widget - WID_CS_FLAT_LAND_HEIGHT_TEXT, 0, _settings_game.construction.max_heightlevel);
 
				}
 
				_left_button_clicked = false;
 
				break;
 

	
 
			case WID_CS_FLAT_LAND_HEIGHT_TEXT: // Height level text
 
				this->widget_id = WID_CS_FLAT_LAND_HEIGHT_TEXT;
 
@@ -1037,13 +1037,13 @@ struct CreateScenarioWindow : public Win
 
					this->SetWidgetDirty(WID_CS_START_DATE_TEXT);
 
					_settings_newgame.game_creation.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR);
 
					break;
 

	
 
				case WID_CS_FLAT_LAND_HEIGHT_TEXT:
 
					this->SetWidgetDirty(WID_CS_FLAT_LAND_HEIGHT_TEXT);
 
					_settings_newgame.game_creation.se_flat_world_height = Clamp(value, 0, MAX_TILE_HEIGHT);
 
					_settings_newgame.game_creation.se_flat_world_height = Clamp(value, 0, _settings_game.construction.max_heightlevel);
 
					break;
 
			}
 

	
 
			this->SetDirty();
 
		}
 
	}
0 comments (0 inline, 0 general)