Changeset - r24600:8cc6b2a6e8f2
[Not reviewed]
master
0 3 0
Patric Stout - 3 years ago 2021-01-07 08:06:27
truebrain@openttd.org
Fix 2fd871e2af5: load correct ending-year for old (pre 0.7) savegames

Despite what it looked like, you could never really change the
ending-year (it was always reset to 2050 on start-up). See commit
683b65ee1 for details. As a side-effect, the variable that was
suppose to store the ending-year was just zero, never containing
a real ending-year.
3 files changed with 3 insertions and 18 deletions:
0 comments (0 inline, 0 general)
src/date.cpp
Show inline comments
 
@@ -28,8 +28,6 @@ Date      _date;       ///< Current date
 
DateFract _date_fract; ///< Fractional part of the day.
 
uint16 _tick_counter;  ///< Ever incrementing (and sometimes wrapping) tick counter for setting off various events
 

	
 
int32 _old_ending_year_slv_105; ///< Old ending year for savegames before SLV_105
 

	
 
/**
 
 * Set the date.
 
 * @param date  New date
src/saveload/afterload.cpp
Show inline comments
 
@@ -755,12 +755,7 @@ bool AfterLoadGame()
 
		_settings_game.linkgraph.distribution_default = DT_MANUAL;
 
	}
 

	
 
	if (IsSavegameVersionBefore(SLV_105)) {
 
		extern int32 _old_ending_year_slv_105; // in date.cpp
 
		_settings_game.game_creation.ending_year = _old_ending_year_slv_105 - 1;
 
	} else if (IsSavegameVersionBefore(SLV_ENDING_YEAR)) {
 
		/* Ending year was a GUI setting before SLV_105, was removed in revision 683b65ee1 (svn r14755). */
 
		/* This also converts scenarios, both when loading them into the editor, and when starting a new game. */
 
	if (IsSavegameVersionBefore(SLV_ENDING_YEAR)) {
 
		_settings_game.game_creation.ending_year = DEF_END_YEAR;
 
	}
 

	
src/table/settings.ini
Show inline comments
 
@@ -47,8 +47,6 @@ static bool UpdateServerPassword(int32 p
 
static bool UpdateRconPassword(int32 p1);
 
static bool UpdateClientConfigValues(int32 p1);
 

	
 
extern int32 _old_ending_year_slv_105;
 

	
 
/* End - Callback Functions for the various settings */
 

	
 
/* Some settings do not need to be synchronised when playing in multiplayer.
 
@@ -1405,15 +1403,9 @@ str      = STR_CONFIG_SETTING_STARTING_Y
 
strval   = STR_JUST_INT
 
cat      = SC_BASIC
 

	
 
[SDTG_VAR]
 
name     = ""old_ending_year_slv_105""
 
var      = _old_ending_year_slv_105
 
flags    = SLF_NOT_IN_CONFIG
 
type     = SLE_INT32
 
[SDT_NULL]
 
length   = 4
 
to       = SLV_105
 
def      = DEF_END_YEAR
 
min      = MIN_YEAR
 
max      = MAX_YEAR
 

	
 
[SDT_VAR]
 
base     = GameSettings
0 comments (0 inline, 0 general)