diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index af31ec76454..9c0ee2584fc 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -244,7 +244,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car be_special = SANITIZE_LIST(be_special) pda_style = sanitize_inlist(pda_style, GLOB.pda_styles, initial(pda_style)) pda_color = sanitize_hexcolor(pda_color, 6, 1, initial(pda_color)) - key_bindings = sanitize_islist(key_bindings, list()) + key_bindings = sanitize_keybindings(key_bindings) return TRUE @@ -555,6 +555,14 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car return TRUE +/proc/sanitize_keybindings(value) + var/list/base_bindings = sanitize_islist(value,list()) + for(var/key in base_bindings) + base_bindings[key] = base_bindings[key] & GLOB.keybindings_by_name + if(!length(base_bindings[key])) + base_bindings -= key + return base_bindings + #undef SAVEFILE_VERSION_MAX #undef SAVEFILE_VERSION_MIN