diff options
author | rubidium <rubidium@openttd.org> | 2009-01-09 19:34:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-01-09 19:34:05 +0000 |
commit | f902e3097d37480359c7d33e81ab84a7d34be481 (patch) | |
tree | daee530989536bf4d3d116ac674072a06f92260f /src/settings.cpp | |
parent | b0b6285c26f9713e396a8500be570036093fad66 (diff) | |
download | openttd-f902e3097d37480359c7d33e81ab84a7d34be481.tar.xz |
(svn r14938) -Fix: some small inconsistencies w.r.t. "0 is disabled" setting handling
Diffstat (limited to 'src/settings.cpp')
-rw-r--r-- | src/settings.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 4e8eb6404..665ada9d9 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -370,8 +370,7 @@ static void Write_ValidateSetting(void *ptr, const SettingDesc *sd, int32 val) case SLE_VAR_U16: case SLE_VAR_I32: { /* Override the minimum value. No value below sdb->min, except special value 0 */ - int32 min = ((sdb->flags & SGF_0ISDISABLED) && val <= sdb->min) ? 0 : sdb->min; - val = Clamp(val, min, sdb->max); + if (!(sdb->flags & SGF_0ISDISABLED) || val != 0) val = Clamp(val, sdb->min, sdb->max); } break; case SLE_VAR_U32: { /* Override the minimum value. No value below sdb->min, except special value 0 */ |