From 2815f1e5cc55b59f7d8adac78a0ab4e3cb53c814 Mon Sep 17 00:00:00 2001 From: RengaN02 <60517664+RengaN02@users.noreply.github.com> Date: Thu, 25 Sep 2025 02:41:36 +0300 Subject: [PATCH] Fixes a possible runtime in future (#93097) ## About The Pull Request If someones delete a keybind this runtime will appear. image This pr preverents it ## Why It's Good For The Game Fixes are good, bugs are bad (except hk) ## Changelog Not player faced --- code/modules/client/preferences_savefile.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index af6d206ccd5..74b989ca9ef 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -242,7 +242,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car update_preferences(data_validity_integer, savefile) check_keybindings() // this apparently fails every time and overwrites any unloaded prefs with the default values, so don't load anything after this line or it won't actually save - key_bindings_by_key = get_key_bindings_by_key(key_bindings) //Sanitize lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog)) @@ -252,6 +251,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car key_bindings = sanitize_keybindings(key_bindings) favorite_outfits = SANITIZE_LIST(favorite_outfits) + key_bindings_by_key = get_key_bindings_by_key(key_bindings) + if(SHOULD_UPDATE_DATA(data_validity_integer)) //save the updated version var/old_default_slot = default_slot var/old_max_save_slots = max_save_slots