From d512b362ed7fff36633d2b93e77f3d013cd1d2d2 Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Tue, 17 Jul 2018 20:27:47 -0400 Subject: [PATCH] keep equipped items on species change --- code/modules/mob/living/carbon/human/human.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 64ecd8d2699..2f6465289cf 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1319,8 +1319,19 @@ if(!(dna.species.bodyflags & HAS_SKIN_TONE)) s_tone = 0 + var/list/thing_to_check = list(slot_wear_mask, slot_head, slot_shoes, slot_gloves, slot_l_ear, slot_r_ear, slot_glasses, slot_l_hand, slot_r_hand) + var/list/kept_items[0] + + for(var/thing in thing_to_check) + var/obj/item/I = get_item_by_slot(thing) + if(I) + kept_items[I] = thing + dna.species.create_organs(src) + for(var/thing in kept_items) + equip_to_slot_or_del(thing, kept_items[thing]) + //Handle default hair/head accessories for created mobs. var/obj/item/organ/external/head/H = get_organ("head") if(dna.species.default_hair)