summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-07 08:26:09 +0000
committerrubidium <rubidium@openttd.org>2009-01-07 08:26:09 +0000
commit9888afd6d08db5b067d5b50ffedaeb587ea896aa (patch)
treecf8420cd312f57b3c8cd828a1d5adfd2a665d644
parent1ada1a4ff21c1dcada68540ba9650d33503b8507 (diff)
downloadopenttd-9888afd6d08db5b067d5b50ffedaeb587ea896aa.tar.xz
(svn r14885) -Fix: if settings minimum != 1 and 0-is-disabled is enabled, one could set the setting in-game to an out-of-valid-range value.
-rw-r--r--src/settings_gui.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 3020aaba0..30bad8889 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -923,6 +923,7 @@ struct PatchesSelectionWindow : Window {
if (x >= 10) {
value += step;
if (value > sdb->max) value = sdb->max;
+ if (value < sdb->min) value = sdb->min; // skip between "disabled" and minimum
} else {
value -= step;
if (value < sdb->min) value = (sdb->flags & SGF_0ISDISABLED) ? 0 : sdb->min;