summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-28 16:09:58 +0000
committerrubidium <rubidium@openttd.org>2008-12-28 16:09:58 +0000
commit683b65ee180d3685de82bf121492420c4db898e2 (patch)
tree63a4e2275c53d091675758b85913b051a87b9b39
parent87e5a8b52bf2f200467d65c1e17fd79548d31129 (diff)
downloadopenttd-683b65ee180d3685de82bf121492420c4db898e2.tar.xz
(svn r14755) -Codechange: remove ending year as it can't be changed anyways.
-rw-r--r--src/company_cmd.cpp3
-rw-r--r--src/company_gui.cpp2
-rw-r--r--src/date.cpp4
-rw-r--r--src/date_type.h2
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/settings.cpp3
-rw-r--r--src/settings_gui.cpp1
-rw-r--r--src/settings_type.h1
8 files changed, 7 insertions, 10 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index 3dff0984a..6cba226c6 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -1092,9 +1092,6 @@ void LoadFromHighScore()
}
fclose(fp);
}
-
- /* Initialize end of game variable (when to show highscore chart) */
- _settings_client.gui.ending_year = 2051;
}
/* Save/load of companies */
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 50b050546..ea3fb2267 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -1542,7 +1542,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow
this->SetupHighScoreEndWindow(&x, &y);
- SetDParam(0, _settings_client.gui.ending_year);
+ SetDParam(0, ORIGINAL_END_YEAR);
SetDParam(1, this->window_number + STR_6801_EASY);
DrawStringMultiCenter(x + (640 / 2), y + 62, !_networking ? STR_0211_TOP_COMPANIES_WHO_REACHED : STR_TOP_COMPANIES_NETWORK_GAME, 500);
diff --git a/src/date.cpp b/src/date.cpp
index 4b4b94bb0..2b0e6ff09 100644
--- a/src/date.cpp
+++ b/src/date.cpp
@@ -284,8 +284,8 @@ void IncreaseDate()
if (_cur_year == _settings_client.gui.semaphore_build_before) ResetSignalVariant();
/* check if we reached end of the game */
- if (_cur_year == _settings_client.gui.ending_year) {
- ShowEndGameChart();
+ if (_cur_year == ORIGINAL_END_YEAR) {
+ ShowEndGameChart();
/* check if we reached the maximum year, decrement dates by a year */
} else if (_cur_year == MAX_YEAR + 1) {
Vehicle *v;
diff --git a/src/date_type.h b/src/date_type.h
index ddb6dfc7c..49b006c60 100644
--- a/src/date_type.h
+++ b/src/date_type.h
@@ -22,6 +22,8 @@
/** The minimum starting year/base year of the original TTD */
#define ORIGINAL_BASE_YEAR 1920
+/** The original ending year */
+#define ORIGINAL_END_YEAR 2051
/** The maximum year of the original TTD */
#define ORIGINAL_MAX_YEAR 2090
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 8945a7307..725af58a0 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1175,7 +1175,6 @@ STR_CONFIG_PATCHES_DISABLE_ELRAILS :{LTBLUE}Disable
STR_CONFIG_PATCHES_COLORED_NEWS_YEAR :{LTBLUE}Coloured news appears in: {ORANGE}{STRING1}
STR_CONFIG_PATCHES_STARTING_YEAR :{LTBLUE}Starting year: {ORANGE}{STRING1}
-STR_CONFIG_PATCHES_ENDING_YEAR :{LTBLUE}End game in: {ORANGE}{STRING1}
STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Enable smooth economy (more, smaller changes)
STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Allow buying shares from other companies
STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}When dragging, place signals every: {ORANGE}{STRING1} tile(s)
diff --git a/src/settings.cpp b/src/settings.cpp
index 8ae90da63..fd52880f3 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -363,6 +363,7 @@ static void Write_ValidateSetting(void *ptr, const SettingDesc *sd, int32 val)
* 32-bit variable
* TODO: Support 64-bit settings/variables */
switch (GetVarMemType(sd->save.conv)) {
+ case SLE_VAR_NULL: return;
case SLE_VAR_BL:
case SLE_VAR_I8:
case SLE_VAR_U8:
@@ -1325,7 +1326,7 @@ const SettingDesc _patch_settings[] = {
SDT_VAR(GameSettings, game_creation.snow_line_height, SLE_UINT8, 0, 0, 7, 2, 13, 0, STR_CONFIG_PATCHES_SNOWLINE_HEIGHT, NULL),
SDTC_VAR( gui.colored_news_year, SLE_INT32, 0,NC, 2000,MIN_YEAR,MAX_YEAR,1,STR_CONFIG_PATCHES_COLORED_NEWS_YEAR, NULL),
SDT_VAR(GameSettings, game_creation.starting_year, SLE_INT32, 0,NC, 1950,MIN_YEAR,MAX_YEAR,1,STR_CONFIG_PATCHES_STARTING_YEAR, NULL),
- SDTC_VAR( gui.ending_year, SLE_INT32, 0,NC|NO,2051,MIN_YEAR,MAX_YEAR,1,STR_CONFIG_PATCHES_ENDING_YEAR, NULL),
+ SDT_CONDNULL( 4, 0, 104),
SDT_BOOL(GameSettings, economy.smooth_economy, 0, 0, true, STR_CONFIG_PATCHES_SMOOTH_ECONOMY, NULL),
SDT_BOOL(GameSettings, economy.allow_shares, 0, 0, false, STR_CONFIG_PATCHES_ALLOW_SHARES, NULL),
SDT_CONDVAR(GameSettings, economy.town_growth_rate, SLE_UINT8, 54, SL_MAX_VERSION, 0, MS, 2, 0, 4, 0, STR_CONFIG_PATCHES_TOWN_GROWTH, NULL),
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 7b73a0a7e..4566fa338 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -655,7 +655,6 @@ static const char *_patches_economy[] = {
"economy.exclusive_rights",
"economy.give_money",
"gui.colored_news_year",
- "gui.ending_year",
"economy.smooth_economy",
"economy.allow_shares",
"economy.town_layout",
diff --git a/src/settings_type.h b/src/settings_type.h
index adef05995..0c9d366b3 100644
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -68,7 +68,6 @@ struct GUISettings {
uint8 scrollwheel_multiplier; ///< how much 'wheel' per incoming event from the OS?
bool pause_on_newgame; ///< whether to start new games paused or not
bool enable_signal_gui; ///< show the signal GUI when the signal button is pressed
- Year ending_year; ///< end of the game (just show highscore)
Year colored_news_year; ///< when does newspaper become colored?
bool timetable_in_ticks; ///< whether to show the timetable in ticks rather than days
bool bridge_pillars; ///< show bridge pillars for high bridges