(svn r26880) -Add: stub settings for limiting bridge and map height

This commit is contained in:
rubidium 2014-09-21 11:27:34 +00:00
parent 9daf7e749c
commit f41b55f0ff
5 changed files with 35 additions and 0 deletions

View File

@ -36,6 +36,7 @@ struct Cheats {
Cheat change_date; ///< changes date ingame
Cheat setup_prod; ///< setup raw-material production in game
Cheat dummy3; ///< empty cheat (enable running el-engines on normal rail)
Cheat edit_max_hl; ///< edit the maximum heightlevel
};
extern Cheats _cheats;

View File

@ -583,6 +583,8 @@ bool AfterLoadGame()
}
if (IsSavegameVersionBefore(194)) {
_settings_game.construction.max_heightlevel = 15;
/* In old savegame versions, the heightlevel was coded in bits 0..3 of the type field */
for (TileIndex t = 0; t < map_size; t++) {
_m[t].height = GB(_m[t].type, 0, 4);

View File

@ -296,9 +296,11 @@ struct GameCreationSettings {
/** Settings related to construction in-game */
struct ConstructionSettings {
uint8 max_heightlevel; ///< maximum allowed heightlevel
bool build_on_slopes; ///< allow building on slopes
bool autoslope; ///< allow terraforming under things
uint16 max_bridge_length; ///< maximum length of bridges
byte max_bridge_height; ///< maximum height of bridges
uint16 max_tunnel_length; ///< maximum length of tunnels
byte train_signal_side; ///< show signals on left / driving / right side
bool extra_dynamite; ///< extra dynamite

View File

@ -377,6 +377,19 @@ proc = CheckRoadSide
; Construction
[SDT_VAR]
base = GameSettings
var = construction.max_heightlevel
type = SLE_UINT8
from = 194
guiflags = SGF_NEWGAME_ONLY | SGF_NO_NETWORK
def = DEF_MAX_HEIGHTLEVEL
min = MIN_MAX_HEIGHTLEVEL
max = MAX_MAX_HEIGHTLEVEL
interval = 1
strval = STR_JUST_INT
cat = SC_BASIC
[SDT_BOOL]
base = GameSettings
var = construction.build_on_slopes
@ -494,6 +507,19 @@ str = STR_CONFIG_SETTING_MAX_BRIDGE_LENGTH
strhelp = STR_CONFIG_SETTING_MAX_BRIDGE_LENGTH_HELPTEXT
strval = STR_CONFIG_SETTING_TILE_LENGTH
[SDT_VAR]
base = GameSettings
var = construction.max_bridge_height
type = SLE_UINT8
from = 194
guiflags = SGF_NO_NETWORK
def = 12
min = 1
max = MAX_TILE_HEIGHT
interval = 1
strval = STR_JUST_COMMA
cat = SC_EXPERT
[SDT_VAR]
base = GameSettings
var = construction.max_tunnel_length

View File

@ -19,6 +19,10 @@ static const uint TILE_HEIGHT = 8; ///< The standard height-diffe
static const uint MAX_TILE_HEIGHT = 15; ///< Maximum allowed tile height
static const uint MIN_MAX_HEIGHTLEVEL = 15; ///< Lower bound of maximum allowed heightlevel (in the construction settings)
static const uint DEF_MAX_HEIGHTLEVEL = 15; ///< Default maximum allowed heightlevel (in the construction settings)
static const uint MAX_MAX_HEIGHTLEVEL = MAX_TILE_HEIGHT; ///< Upper bound of maximum allowed heightlevel (in the construction settings)
static const uint MIN_SNOWLINE_HEIGHT = 2; ///< Minimum snowline height
static const uint DEF_SNOWLINE_HEIGHT = 7; ///< Default snowline height
static const uint MAX_SNOWLINE_HEIGHT = (MAX_TILE_HEIGHT - 2); ///< Maximum allowed snowline height