summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-01-18 21:44:31 +0000
committerrubidium <rubidium@openttd.org>2010-01-18 21:44:31 +0000
commita8749ffa5be6a0392330324b7756a3f923ab1e35 (patch)
tree82e76e4667002aa43eb3606f338b682601c646ae
parenta203eaf18fc55d1b817fac72764487c18260230b (diff)
downloadopenttd-a8749ffa5be6a0392330324b7756a3f923ab1e35.tar.xz
(svn r18864) -Fix [FS#3532]: town noise population settings could not be changed in-game
-rw-r--r--src/settings.cpp15
-rw-r--r--src/table/settings.h9
2 files changed, 4 insertions, 20 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 703012c81..8a091816f 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -896,21 +896,6 @@ static int32 ConvertLandscape(const char *value)
return lookup_oneofmany("normal|hilly|desert|candy", value);
}
-/**
- * Check for decent values been supplied by the user for the noise tolerance setting.
- * The primary idea is to avoid division by zero in game mode.
- * The secondary idea is to make it so the values will be somewhat sane and that towns will
- * not be overcrowed with airports. It would be easy to abuse such a feature
- * So basically, 200, 400, 800 are the lowest allowed values */
-static int32 CheckNoiseToleranceLevel(const char *value)
-{
- GameSettings *s = (_game_mode == GM_MENU) ? &_settings_newgame : &_settings_game;
- for (uint16 i = 0; i < lengthof(s->economy.town_noise_population); i++) {
- s->economy.town_noise_population[i] = max(uint16(200 * (i + 1)), s->economy.town_noise_population[i]);
- }
- return 0;
-}
-
static bool CheckFreeformEdges(int32 p1)
{
if (_game_mode == GM_MENU) return true;
diff --git a/src/table/settings.h b/src/table/settings.h
index 74fa1d105..83ddeb0cf 100644
--- a/src/table/settings.h
+++ b/src/table/settings.h
@@ -30,7 +30,6 @@ static bool DifficultyChange(int32);
static bool DifficultyNoiseChange(int32 i);
static bool CheckRoadSide(int p1);
static int32 ConvertLandscape(const char *value);
-static int32 CheckNoiseToleranceLevel(const char *value);
static bool CheckFreeformEdges(int32 p1);
static bool ChangeDynamicEngines(int32 p1);
static bool StationCatchmentChanged(int32 p1);
@@ -147,8 +146,6 @@ static bool UpdateClientConfigValues(int32 p1);
SDT_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, base, var, lengthof(((base*)8)->var), def, 0, 0, 0, NULL, str, proc, NULL, from, to)
#define SDT_LIST(base, var, type, flags, guiflags, def, str, proc)\
SDT_CONDLIST(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, str, proc)
-#define SDT_CONDLISTO(base, var, length, type, from, to, flags, guiflags, def, str, proc, load)\
- SDT_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, base, var, length, def, 0, 0, 0, NULL, str, proc, load, from, to)
#define SDT_CONDSTR(base, var, type, from, to, flags, guiflags, def, str, proc)\
SDT_GENERAL(#var, SDT_STRING, SL_STR, type, flags, guiflags, base, var, lengthof(((base*)8)->var), def, 0, 0, 0, NULL, str, proc, NULL, from, to)
@@ -453,7 +450,9 @@ const SettingDesc _settings[] = {
SDT_VAR(GameSettings, economy.dist_local_authority, SLE_UINT8, 0, 0, 20, 5, 60, 0, STR_NULL, NULL),
SDT_VAR(GameSettings, pf.wait_oneway_signal, SLE_UINT8, 0, 0, 15, 2, 255, 0, STR_NULL, NULL),
SDT_VAR(GameSettings, pf.wait_twoway_signal, SLE_UINT8, 0, 0, 41, 2, 255, 0, STR_NULL, NULL),
- SDT_CONDLISTO(GameSettings, economy.town_noise_population, 3, SLE_UINT16, 96, SL_MAX_VERSION, 0,D0, "800,2000,4000", STR_NULL, NULL, CheckNoiseToleranceLevel),
+ SDT_CONDVAR(GameSettings, economy.town_noise_population[0], SLE_UINT16, 96, SL_MAX_VERSION, 0, 0, 800, 200, 65535, 0, STR_NULL, NULL),
+ SDT_CONDVAR(GameSettings, economy.town_noise_population[1], SLE_UINT16, 96, SL_MAX_VERSION, 0, 0, 2000, 400, 65535, 0, STR_NULL, NULL),
+ SDT_CONDVAR(GameSettings, economy.town_noise_population[2], SLE_UINT16, 96, SL_MAX_VERSION, 0, 0, 4000, 800, 65535, 0, STR_NULL, NULL),
SDT_CONDVAR(GameSettings, pf.wait_for_pbs_path, SLE_UINT8,100, SL_MAX_VERSION, 0, 0, 30, 2, 255, 0, STR_NULL, NULL),
SDT_CONDBOOL(GameSettings, pf.reserve_paths, 100, SL_MAX_VERSION, 0, 0, false, STR_NULL, NULL),
@@ -468,7 +467,7 @@ const SettingDesc _settings[] = {
SDT_VAR(GameSettings, pf.npf.npf_rail_lastred_penalty, SLE_UINT, 0, 0, ( 10 * NPF_TILE_LENGTH), 0, 100000, 0, STR_NULL, NULL),
SDT_VAR(GameSettings, pf.npf.npf_rail_station_penalty, SLE_UINT, 0, 0, ( 1 * NPF_TILE_LENGTH), 0, 100000, 0, STR_NULL, NULL),
SDT_VAR(GameSettings, pf.npf.npf_rail_slope_penalty, SLE_UINT, 0, 0, ( 1 * NPF_TILE_LENGTH), 0, 100000, 0, STR_NULL, NULL),
- SDT_VAR(GameSettings, pf.npf.npf_rail_curve_penalty, SLE_UINT, 0, 0, ( 1 * NPF_TILE_LENGTH), 0, 100000, 0, STR_NULL, NULL),
+ SDT_VAR(GameSettings, pf.npf.npf_rail_curve_penalty, SLE_UINT, 0, 0, ( 1 * NPF_TILE_LENGTH), 0, 100000, 0, STR_NULL, NULL),
SDT_VAR(GameSettings, pf.npf.npf_rail_depot_reverse_penalty, SLE_UINT, 0, 0, ( 50 * NPF_TILE_LENGTH), 0, 100000, 0, STR_NULL, NULL),
SDT_CONDVAR(GameSettings, pf.npf.npf_rail_pbs_cross_penalty, SLE_UINT,100, SL_MAX_VERSION, 0, 0, ( 3 * NPF_TILE_LENGTH), 0, 100000, 0, STR_NULL, NULL),
SDT_CONDVAR(GameSettings, pf.npf.npf_rail_pbs_signal_back_penalty, SLE_UINT,100, SL_MAX_VERSION, 0, 0, ( 15 * NPF_TILE_LENGTH), 0, 100000, 0, STR_NULL, NULL),