mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r19978) -Add: Read settings during SL_LOAD_CHECK.
This commit is contained in:
parent
86244ad31e
commit
0270ca846e
@ -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();
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user