From 38114c537c4f0fb95a0cca75e6dc5688bcb671f1 Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Fri, 22 Nov 2013 12:52:25 -0600 Subject: [PATCH] Bugfix: is_loyalty_implanted() now checks to make sure the implant is actually implanted and now in your hand. implant adding via the traitor panel will also update it's location to be in the players head for autopsy as well as is_loyalty_implanted() reasons. Thanks Chinsky / alex-gh for the heads up on this. --- code/datums/mind.dm | 13 +++++++++++-- code/modules/mob/living/carbon/human/human.dm | 4 +++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index f073d6e7ee3..16bd1d3e5ae 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -508,10 +508,19 @@ datum/mind switch(href_list["implant"]) if("remove") for(var/obj/item/weapon/implant/loyalty/I in H.contents) - I.Del() + for(var/datum/organ/external/organs in H.organs) + if(I in organs.implants) + I.Del() + break H << "\blue Your loyalty implant has been deactivated." if("add") - H.contents.Add( new /obj/item/weapon/implant/loyalty (src) ) + var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) + L.imp_in = H + L.implanted = 1 + var/datum/organ/external/affected = H.organs_by_name["head"] + affected.implants += L + L.part = affected + H << "\red You somehow have become the recepient of a loyalty transplant, and it just activated!" if(src in ticker.mode.revolutionaries) special_role = null diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index f3d66aa3fc5..7a3bb5bbf08 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -320,7 +320,9 @@ /mob/living/carbon/human/proc/is_loyalty_implanted(mob/living/carbon/human/M) for(var/L in M.contents) if(istype(L, /obj/item/weapon/implant/loyalty)) - return 1 + for(var/datum/organ/external/O in M.organs) + if(L in O.implants) + return 1 return 0 /mob/living/carbon/human/attack_slime(mob/living/carbon/slime/M as mob)