diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-09-18 20:18:45 +0200 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-12-28 12:27:39 +0100 |
commit | 2fd871e2af5cb9e239628843fbd40499ee43406a (patch) | |
tree | 25973b79c47ddece4a820807f1fb4694bd85b51b /src/saveload/afterload.cpp | |
parent | 69f9529ba32df396c4353b2d1c752a3f6609069a (diff) | |
download | openttd-2fd871e2af5cb9e239628843fbd40499ee43406a.tar.xz |
Feature: Configurable game ending year
Functionally reverts 683b65ee1
Diffstat (limited to 'src/saveload/afterload.cpp')
-rw-r--r-- | src/saveload/afterload.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index dd9fcd534..47d2c7b03 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -747,6 +747,15 @@ 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. */ + _settings_game.game_creation.ending_year = DEF_END_YEAR; + } + /* Load the sprites */ GfxLoadSprites(); LoadStringWidthTable(); |