Dedicated equipment removal proc (#31411)

* Dedicated equipment removal proc

* department of redundancy department

* Whitespace makes me angry
This commit is contained in:
AnturK
2017-10-08 20:17:35 +02:00
committed by CitadelStationBot
parent c91d54c6a6
commit 3f975a63b7
2 changed files with 10 additions and 1 deletions
@@ -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.
@@ -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)