mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r24247) -Fix: If loading of int-list settings fails, use the default.
This commit is contained in:
parent
ce5c936b07
commit
c11d80148f
|
@ -507,7 +507,8 @@ static void IniLoadSettings(IniFile *ini, const SettingDesc *sd, const char *grp
|
||||||
case SDT_NUMX:
|
case SDT_NUMX:
|
||||||
case SDT_ONEOFMANY:
|
case SDT_ONEOFMANY:
|
||||||
case SDT_MANYOFMANY:
|
case SDT_MANYOFMANY:
|
||||||
Write_ValidateSetting(ptr, sd, (int32)(size_t)p); break;
|
Write_ValidateSetting(ptr, sd, (int32)(size_t)p);
|
||||||
|
break;
|
||||||
|
|
||||||
case SDT_STRING:
|
case SDT_STRING:
|
||||||
switch (GetVarMemType(sld->conv)) {
|
switch (GetVarMemType(sld->conv)) {
|
||||||
|
@ -532,6 +533,9 @@ static void IniLoadSettings(IniFile *ini, const SettingDesc *sd, const char *grp
|
||||||
if (!LoadIntList((const char*)p, ptr, sld->length, GetVarMemType(sld->conv))) {
|
if (!LoadIntList((const char*)p, ptr, sld->length, GetVarMemType(sld->conv))) {
|
||||||
SetDParamStr(0, sdb->name);
|
SetDParamStr(0, sdb->name);
|
||||||
ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_ARRAY, WL_CRITICAL);
|
ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_ARRAY, WL_CRITICAL);
|
||||||
|
|
||||||
|
/* Use default */
|
||||||
|
LoadIntList((const char*)sdb->def, ptr, sld->length, GetVarMemType(sld->conv));
|
||||||
} else if (sd->desc.proc_cnvt != NULL) {
|
} else if (sd->desc.proc_cnvt != NULL) {
|
||||||
sd->desc.proc_cnvt((const char*)p);
|
sd->desc.proc_cnvt((const char*)p);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue