summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/settings_gui.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 126d2df10..587a664a2 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1479,7 +1479,12 @@ struct GameSettingsWindow : Window {
/* Increase or decrease the value and clamp it to extremes */
if (x >= 10) {
value += step;
- if ((uint32)value > sdb->max) value = (int32)sdb->max;
+ if (sdb->min < 0) {
+ assert((int32)sdb->max >= 0);
+ if (value > (int32)sdb->max) value = (int32)sdb->max;
+ } else {
+ if ((uint32)value > sdb->max) value = (int32)sdb->max;
+ }
if (value < sdb->min) value = sdb->min; // skip between "disabled" and minimum
} else {
value -= step;