From 64cda4aa5ab66e02c07b2acfaac009fd1191a8bd Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Mon, 13 Jul 2015 10:20:46 +0200 Subject: [PATCH] Destroyed items now use drop_from_inventory instead of unEquip. Reduces the risk of references being kept in case of held items. --- code/game/objects/items.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 0c4450881e..2a68cb87f7 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -65,9 +65,10 @@ /obj/item/Destroy() if(ismob(loc)) var/mob/m = loc - m.unEquip(src, 1) + m.drop_from_inventory(src) m.update_inv_r_hand() m.update_inv_l_hand() + src.loc = null return ..() /obj/item/device @@ -604,4 +605,4 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. /obj/item/proc/pwr_drain() - return 0 // Process Kill + return 0 // Process Kill