summaryrefslogtreecommitdiff
path: root/settings_gui.c
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2004-08-13 22:33:48 +0000
committerdominik <dominik@openttd.org>2004-08-13 22:33:48 +0000
commitdf61b336dbdd2a6d311ad20c10afec0c0903c0c1 (patch)
tree7c83cc426c111645aa20a471f0083fc3142eab98 /settings_gui.c
parent15f3aaf82490f7f2f25654e649b3db502f1de4ac (diff)
downloadopenttd-df61b336dbdd2a6d311ad20c10afec0c0903c0c1.tar.xz
(svn r48) Fix: Possible to disable some patches (e.g. default service interval) again by setting them to 0
Diffstat (limited to 'settings_gui.c')
-rw-r--r--settings_gui.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/settings_gui.c b/settings_gui.c
index cd214f7c4..ecf3714bb 100644
--- a/settings_gui.c
+++ b/settings_gui.c
@@ -816,6 +816,8 @@ static void WritePE(const PatchEntry *pe, int32 val)
case PE_UINT16: if ((uint16)val > (uint16)pe->max)
*(uint16*)pe->variable = (uint16)pe->max;
+ else if ( (pe->flags & PF_0ISDIS) && ((int16)val < (int16)pe->min) )
+ *(int16*)pe->variable = 0;
else if ((uint16)val < (uint16)pe->min)
*(uint16*)pe->variable = (uint16)pe->min;
else
@@ -940,10 +942,10 @@ static void PatchesSelectionWndProc(Window *w, WindowEvent *e)
val += pe->step;
if (val > pe->max) val = pe->max;
} else {
+ // decrease
if (val <= pe->min && pe->flags & PF_0ISDIS) {
val = 0;
} else {
- // decrease
val -= pe->step;
if (val < pe->min) val = pe->min;
}