mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
Adds keybindings sanity. (#51627)
* Adds keybindings sanity. * Whoops * clears the key if it's unsed
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user