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

pull/155/head
rubidium 15 years ago
parent 4f78ef88b0
commit 62f770a5fc

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

Loading…
Cancel
Save