# HG changeset patch # User darkvater # Date 1092438767 0 # Node ID 20d80c99ef027f16d775442f541463c5d817aba6 # Parent 8368e4d4ef072009829e871c4aef173065d538a3 (svn r49) -'Disabled' in patch settings universal for all pe->variable types (dominik81). diff -r 8368e4d4ef07 -r 20d80c99ef02 settings_gui.c --- a/settings_gui.c Fri Aug 13 22:33:48 2004 +0000 +++ b/settings_gui.c Fri Aug 13 23:12:47 2004 +0000 @@ -795,6 +795,12 @@ static void WritePE(const PatchEntry *pe, int32 val) { + + if ((pe->flags & PF_0ISDIS) && val <= 0) { + *(bool*)pe->variable = 0; // "clamp" 'disabled' value to smallest type, PE_BOOL + return; + } + switch(pe->type) { case PE_BOOL: *(bool*)pe->variable = (bool)val; break; @@ -816,8 +822,6 @@ 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