From 6b9f3a059e3f6d66948e07f18e78a9d69c333921 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Fri, 27 Aug 2021 10:23:39 -0400 Subject: [PATCH] Merge pull request #11514 from Verkister/patch-80 Fixes unresetable loadout name/desc gear tweaks --- .../client/preference_setup/loadout/gear_tweaks.dm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/client/preference_setup/loadout/gear_tweaks.dm b/code/modules/client/preference_setup/loadout/gear_tweaks.dm index 90e378fbb0..11e0f1f777 100644 --- a/code/modules/client/preference_setup/loadout/gear_tweaks.dm +++ b/code/modules/client/preference_setup/loadout/gear_tweaks.dm @@ -172,7 +172,8 @@ var/datum/gear_tweak/custom_name/gear_tweak_free_name = new() return if(valid_custom_names) return tgui_input_list(user, "Choose an item name.", "Character Preference", valid_custom_names, metadata) - return sanitize(input(user, "Choose the item's name. Leave it blank to use the default name.", "Item Name", metadata) as text|null, MAX_LNAME_LEN, extra = 0) + var/san_input = sanitize(input(user, "Choose the item's name. Leave it blank to use the default name.", "Item Name", metadata) as text|null, MAX_LNAME_LEN, extra = 0) + return san_input ? san_input : get_default() /datum/gear_tweak/custom_name/tweak_item(var/obj/item/I, var/metadata) if(!metadata) @@ -203,7 +204,8 @@ var/datum/gear_tweak/custom_desc/gear_tweak_free_desc = new() return if(valid_custom_desc) return tgui_input_list(user, "Choose an item description.", "Character Preference",valid_custom_desc, metadata) - return sanitize(input(user, "Choose the item's description. Leave it blank to use the default description.", "Item Description", metadata) as message|null, extra = 0) + var/san_input = sanitize(input(user, "Choose the item's description. Leave it blank to use the default description.", "Item Description", metadata) as message|null, extra = 0) + return san_input ? san_input : get_default() /datum/gear_tweak/custom_desc/tweak_item(var/obj/item/I, var/metadata) if(!metadata) @@ -551,4 +553,4 @@ var/datum/gear_tweak/custom_desc/gear_tweak_free_desc = new() /datum/gear_tweak/implant_location/get_metadata(var/user, var/metadata) return (tgui_input_list(user, "Select a bodypart for the implant to be implanted inside.", "Implant Location", bodypart_names_to_tokens || bodypart_tokens_to_names[BP_TORSO])) -#undef LOADOUT_BAN_STRING \ No newline at end of file +#undef LOADOUT_BAN_STRING