summaryrefslogtreecommitdiff
path: root/settings.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-03-16 00:20:33 +0000
committerDarkvater <Darkvater@openttd.org>2006-03-16 00:20:33 +0000
commit650b1b0c93ea5bb300463c8604700685f31826fb (patch)
treeac6cdd2863b4bb080d7d84f5549642dad620393f /settings.c
parent9ae2e006447d7aedd275bf1fc060b7c3582a9569 (diff)
downloadopenttd-650b1b0c93ea5bb300463c8604700685f31826fb.tar.xz
(svn r3895) - Add proper SLE(G)_CONDNULL macros for the empty space reservation in savegames and update where used
- Also add this capability to settings
Diffstat (limited to 'settings.c')
-rw-r--r--settings.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/settings.c b/settings.c
index e6271b960..879c9ec7c 100644
--- a/settings.c
+++ b/settings.c
@@ -615,6 +615,7 @@ static void ini_load_settings(IniFile *ini, const SettingDesc *sd, const char *g
const SaveLoad *sld = &sd->save;
if (!SlIsObjectCurrentlyValid(sld->version_from, sld->version_to)) continue;
+ if (sd->desc.name == NULL) continue;
// XXX - wtf is this?? (group override?)
s = strchr(sdb->name, '.');
@@ -682,6 +683,7 @@ static void ini_save_settings(IniFile *ini, const SettingDesc *sd, const char *g
* file, just continue with the next setting */
if (!SlIsObjectCurrentlyValid(sld->version_from, sld->version_to)) continue;
if (sld->conv & SLF_CONFIG_NO) continue;
+ if (sd->desc.name == NULL) continue;
// XXX - wtf is this?? (group override?)
s = strchr(sdb->name, '.');
@@ -879,6 +881,9 @@ static void ini_save_setting_list(IniFile *ini, const char *grpname, char **list
#define SDTG_MMANY(name, type, flags, guiflags, var, def, full, str, proc)\
SDTG_CONDMMANY(name, type, flags, guiflags, var, def, full, str, proc, 0, SL_MAX_VERSION)
+#define SDTG_CONDNULL(length, from, to)\
+ {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLEG_CONDNULL(length, from, to)}
+
#define SDTG_END() {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLEG_END()}
/* Macros for various objects to go in the configuration file.
@@ -925,6 +930,9 @@ static void ini_save_setting_list(IniFile *ini, const char *grpname, char **list
#define SDT_MMANY(base, var, type, flags, guiflags, def, full, str, proc)\
SDT_CONDMMANY(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, full, str, proc)
+#define SDT_CONDNULL(length, from, to)\
+ {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLE_CONDNULL(length, from, to)}
+
#define SDT_END() {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLE_END()}
/* Shortcuts for macros below. Logically if we don't save the value