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.
This commit is contained in:
ARGUS
2026-03-17 20:20:25 +01:00
committed by GitHub
parent a0028ab07e
commit edf2ebb557
@@ -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")