1
0
Fork 0

(svn r16781) -Fix [FS#3026] (r16297): don't cast negative values to uints when the settings' range is "negative..positive".

release/1.0
rubidium 2009-07-10 16:32:12 +00:00
parent bc32b7dc4c
commit 24305a68ee
1 changed files with 6 additions and 1 deletions

View File

@ -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;