From 3f975a63b7feba699c5c7b2f4084b911f01bd02c Mon Sep 17 00:00:00 2001 From: AnturK Date: Sun, 8 Oct 2017 20:17:35 +0200 Subject: [PATCH 1/2] Dedicated equipment removal proc (#31411) * Dedicated equipment removal proc * department of redundancy department * Whitespace makes me angry --- code/modules/mob/living/carbon/human/dummy.dm | 2 +- code/modules/mob/living/carbon/human/inventory.dm | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/dummy.dm b/code/modules/mob/living/carbon/human/dummy.dm index 0492a0b5e6..018f04ab8f 100644 --- a/code/modules/mob/living/carbon/human/dummy.dm +++ b/code/modules/mob/living/carbon/human/dummy.dm @@ -14,7 +14,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy) return /mob/living/carbon/human/dummy/proc/wipe_state() - QDEL_LIST(contents) + delete_equipment() cut_overlays(TRUE) //Inefficient pooling/caching way. diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 593becfd48..67000ad788 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -260,3 +260,12 @@ return 0 return O.equip(src, visualsOnly) + + +//delete all equipment without dropping anything +/mob/living/carbon/human/proc/delete_equipment() + for(var/slot in get_all_slots())//order matters, dependant slots go first + var/obj/item/I = get_item_by_slot(slot) + qdel(I) + for(var/obj/item/I in held_items) + qdel(I) \ No newline at end of file