From 51d2913161f33aee13ed42e6ee028d11d1d289af Mon Sep 17 00:00:00 2001 From: Lin Date: Sat, 29 Feb 2020 00:13:58 -0600 Subject: [PATCH] more refactor --- code/datums/elements/mob_holder.dm | 3 ++- code/modules/mob/living/silicon/pai/pai_shell.dm | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/code/datums/elements/mob_holder.dm b/code/datums/elements/mob_holder.dm index c2389f91..38c62f4f 100644 --- a/code/datums/elements/mob_holder.dm +++ b/code/datums/elements/mob_holder.dm @@ -153,7 +153,8 @@ L.forceMove(get_turf(L)) L.reset_perspective() L.setDir(SOUTH) - qdel(src) + if(!QDELETED(src)) + qdel(src) /obj/item/clothing/head/mob_holder/relaymove(mob/user) return diff --git a/code/modules/mob/living/silicon/pai/pai_shell.dm b/code/modules/mob/living/silicon/pai/pai_shell.dm index 9a4a1439..ba997b72 100644 --- a/code/modules/mob/living/silicon/pai/pai_shell.dm +++ b/code/modules/mob/living/silicon/pai/pai_shell.dm @@ -86,12 +86,10 @@ if(resting) icon_state = "[chassis]_rest" to_chat(src, "You switch your holochassis projection composite to [chassis]") + current_mob_holder?.Detach(src) + current_mob_holder = null if(possible_chassis[chassis]) current_mob_holder = AddElement(/datum/element/mob_holder, chassis, 'icons/mob/pai_item_head.dmi', 'icons/mob/pai_item_rh.dmi', 'icons/mob/pai_item_lh.dmi', SLOT_HEAD) - else - current_mob_holder?.Detach(src) - current_mob_holder = null - return /mob/living/silicon/pai/lay_down() ..()