diff --git a/src/fios.h b/src/fios.h index 948eae200c..ce8d88c3c8 100644 --- a/src/fios.h +++ b/src/fios.h @@ -17,6 +17,7 @@ #include "core/enum_type.hpp" #include "gfx_type.h" #include "date_type.h" +#include "settings_type.h" /** @@ -30,6 +31,8 @@ struct LoadCheckData { uint32 map_size_x, map_size_y; Date current_date; + GameSettings settings; + LoadCheckData() : error_data(NULL) { this->Clear(); diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index c1617f147a..b96d63a8ac 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -47,6 +47,7 @@ void LoadCheckData::Clear() this->map_size_x = this->map_size_y = 256; // Default for old savegames which do not store mapsize. this->current_date = 0; + memset(&this->settings, 0, sizeof(this->settings)); } diff --git a/src/settings.cpp b/src/settings.cpp index 7255ca0480..a9f40756dd 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -65,6 +65,7 @@ #include "engine_base.h" #include "smallmap_gui.h" #include "roadveh.h" +#include "fios.h" #include "void_map.h" #include "station_base.h" @@ -1967,6 +1968,11 @@ static void Load_PATS() LoadSettings(_settings, &_settings_game); } +static void Check_PATS() +{ + LoadSettings(_settings, &_load_check_data.settings); +} + static void Save_PATS() { SaveSettings(_settings, &_settings_game); @@ -1985,8 +1991,8 @@ void CheckConfig() } extern const ChunkHandler _setting_chunk_handlers[] = { - { 'OPTS', NULL, Load_OPTS, NULL, NULL, CH_RIFF}, - { 'PATS', Save_PATS, Load_PATS, NULL, NULL, CH_RIFF | CH_LAST}, + { 'OPTS', NULL, Load_OPTS, NULL, NULL, CH_RIFF}, + { 'PATS', Save_PATS, Load_PATS, NULL, Check_PATS, CH_RIFF | CH_LAST}, }; static bool IsSignedVarMemType(VarType vt)