diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-20 18:16:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-20 18:16:56 +0400 |
commit | 18fa7589ef2892236dbc5320767956f34a4a98db (patch) | |
tree | 13e67d0f81f801ebd57e8eb5631ee8d390e70b1e /source | |
parent | add48983ca6965c1da7ac7bdd0f4100c04a7a4ce (diff) |
add comment about misuse of enum set function.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 2462733915b..28b034fc164 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -635,11 +635,18 @@ static void rna_wmKeyMapItem_keymodifier_set(PointerRNA *ptr, int value) { wmKeyMapItem *kmi = ptr->data; - if (value == ESCKEY); - else if (value >= AKEY) + /* XXX, this should really be managed in an _itemf function, + * giving a list of valid enums, then silently changing them when they are set is not + * a good precedent, don't do this unless you have a good reason! */ + if (value == ESCKEY) { + /* pass */ + } + else if (value >= AKEY) { kmi->keymodifier = value; - else + } + else { kmi->keymodifier = 0; + } } |