diff --git a/src/fios.h b/src/fios.h index 92f3efc6e3..e65b97141b 100644 --- a/src/fios.h +++ b/src/fios.h @@ -39,7 +39,8 @@ struct LoadCheckData { uint32_t map_size_y = 0; TimerGameCalendar::Date current_date{}; - GameSettings settings{}; + LandscapeType landscape{}; ///< Landscape type. + TimerGameCalendar::Year starting_year{}; ///< Starting date. CompanyPropertiesMap companies{}; ///< Company information. diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index 509a3821df..e3ff376497 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -54,7 +54,8 @@ void LoadCheckData::Clear() this->map_size_x = this->map_size_y = 256; // Default for old savegames which do not store mapsize. this->current_date = CalendarTime::MIN_DATE; - this->settings = {}; + this->landscape = {}; + this->starting_year = {}; companies.clear(); @@ -558,9 +559,8 @@ public: if (tr.top > tr.bottom) return; /* Climate */ - LandscapeType landscape = _load_check_data.settings.game_creation.landscape; - if (to_underlying(landscape) < NUM_LANDSCAPE) { - DrawString(tr, GetString(STR_NETWORK_SERVER_LIST_LANDSCAPE, STR_CLIMATE_TEMPERATE_LANDSCAPE + to_underlying(landscape))); + if (to_underlying(_load_check_data.landscape) < NUM_LANDSCAPE) { + DrawString(tr, GetString(STR_NETWORK_SERVER_LIST_LANDSCAPE, STR_CLIMATE_TEMPERATE_LANDSCAPE + to_underlying(_load_check_data.landscape))); tr.top += GetCharacterHeight(FS_NORMAL); } @@ -568,8 +568,8 @@ public: if (tr.top > tr.bottom) return; /* Start date (if available) */ - if (_load_check_data.settings.game_creation.starting_year != 0) { - DrawString(tr, GetString(STR_NETWORK_SERVER_LIST_START_DATE, TimerGameCalendar::ConvertYMDToDate(_load_check_data.settings.game_creation.starting_year, 0, 1))); + if (_load_check_data.starting_year != 0) { + DrawString(tr, GetString(STR_NETWORK_SERVER_LIST_START_DATE, TimerGameCalendar::ConvertYMDToDate(_load_check_data.starting_year, 0, 1))); tr.top += GetCharacterHeight(FS_NORMAL); } if (tr.top > tr.bottom) return; diff --git a/src/saveload/settings_sl.cpp b/src/saveload/settings_sl.cpp index 62a1a1c243..f8f82ae797 100644 --- a/src/saveload/settings_sl.cpp +++ b/src/saveload/settings_sl.cpp @@ -164,7 +164,11 @@ struct PATSChunkHandler : ChunkHandler { void LoadCheck(size_t) const override { - LoadSettings(GetSaveLoadSettingTable(), &_load_check_data.settings, _settings_sl_compat); + GameSettings settings{}; + LoadSettings(GetSaveLoadSettingTable(), &settings, _settings_sl_compat); + /* We're only interested in landscape and starting year. */ + _load_check_data.landscape = settings.game_creation.landscape; + _load_check_data.starting_year = settings.game_creation.starting_year; } void Save() const override