From edf2ebb557c36a8a690bc42bba652e785099bfb3 Mon Sep 17 00:00:00 2001 From: ARGUS <268038739+ARGUS-Memory@users.noreply.github.com> Date: Tue, 17 Mar 2026 20:20:25 +0100 Subject: [PATCH] Fix Copy Slot sharing references between loadout slots (#19296) copy_loadout used check_list_copy on the outer gear list only, leaving the inner tweak metadata lists as shared references. Modifications to gear tweaks in the copied slot would write into the shared inner lists, affecting the original slot until a save/reload cycle broke the reference. Fix: deep copy both levels, matching the pattern used for body_markings in 03_body.dm. --- code/modules/client/preference_setup/loadout/02_loadout.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/client/preference_setup/loadout/02_loadout.dm b/code/modules/client/preference_setup/loadout/02_loadout.dm index 611f8dd3cd..c33ade3535 100644 --- a/code/modules/client/preference_setup/loadout/02_loadout.dm +++ b/code/modules/client/preference_setup/loadout/02_loadout.dm @@ -228,7 +228,10 @@ GLOBAL_LIST_EMPTY_TYPED(gear_datums, /datum/gear) if(confirm != "Yes") return TOPIC_HANDLED - pref.gear_list["[copy_to]"] = check_list_copy(active_gear_list) + var/list/slot_copy = check_list_copy(active_gear_list) + for(var/gear_name in slot_copy) + slot_copy[gear_name] = check_list_copy(slot_copy[gear_name]) + pref.gear_list["[copy_to]"] = slot_copy return TOPIC_REFRESH if("toggle_gear")