diff options
author | michi_cc <michi_cc@openttd.org> | 2012-04-17 19:45:04 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2012-04-17 19:45:04 +0000 |
commit | 3f267db3a6928873a7041f281a2fb5d2abbd423c (patch) | |
tree | 3971c3451448fd831ff4da178f909bc80b8a03ef /src/settings.cpp | |
parent | 6c8a16f36e749ce3302a71ebb6b86356679aa657 (diff) | |
download | openttd-3f267db3a6928873a7041f281a2fb5d2abbd423c.tar.xz |
(svn r24146) -Fix [FS#5153]: Use default value when reading an invalid setting value. (Eddi)
Diffstat (limited to 'src/settings.cpp')
-rw-r--r-- | src/settings.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index ff988ad9d..2b109e51e 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -364,7 +364,7 @@ static const void *StringToVal(const SettingDescBase *desc, const char *orig_str SetDParamStr(0, str); SetDParamStr(1, desc->name); ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_VALUE, WL_CRITICAL); - return 0; + return desc->def; } case SDT_MANYOFMANY: { @@ -373,7 +373,7 @@ static const void *StringToVal(const SettingDescBase *desc, const char *orig_str SetDParamStr(0, str); SetDParamStr(1, desc->name); ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_VALUE, WL_CRITICAL); - return NULL; + return desc->def; } case SDT_BOOLX: @@ -383,7 +383,7 @@ static const void *StringToVal(const SettingDescBase *desc, const char *orig_str SetDParamStr(0, str); SetDParamStr(1, desc->name); ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_VALUE, WL_CRITICAL); - break; + return desc->def; case SDT_STRING: return orig_str; case SDT_INTLIST: return str; |