From 391cb8cb2887eaddb4a493a4c93a49a8a017f75a Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 4 Oct 2020 23:36:30 +0200 Subject: [PATCH] [MIRROR] Thick material check fix (#1154) * Thick material check fix (#54165) Thick material checks (like syringes and such) are now applied on a bodypart by bodypart basis, rather than just depending on your suit. * Thick material check fix Co-authored-by: Rohesie --- code/modules/mob/living/carbon/human/human.dm | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 6498724b586..8ebd68b16b3 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -549,22 +549,16 @@ . = FALSE else if(HAS_TRAIT(src, TRAIT_PIERCEIMMUNE)) . = FALSE - // If targeting the head, see if the head item is thin enough. - // If targeting anything else, see if the wear suit is thin enough. - if (!penetrate_thick) - if(above_neck(target_zone)) - if(head && istype(head, /obj/item/clothing)) - var/obj/item/clothing/CH = head - if (CH.clothing_flags & THICKMATERIAL) - . = FALSE - else - if(wear_suit && istype(wear_suit, /obj/item/clothing)) - var/obj/item/clothing/CS = wear_suit - if (CS.clothing_flags & THICKMATERIAL) - . = FALSE + var/obj/item/bodypart/the_part = get_bodypart(target_zone) || get_bodypart(BODY_ZONE_CHEST) + // Loop through the clothing covering this bodypart and see if there's any thiccmaterials + if(!penetrate_thick) + for(var/obj/item/clothing/iter_clothing in clothingonpart(the_part)) + if(iter_clothing.clothing_flags & THICKMATERIAL) + . = FALSE + break if(!. && error_msg && user) // Might need re-wording. - to_chat(user, "There is no exposed flesh or thin material [above_neck(target_zone) ? "on [p_their()] head" : "on [p_their()] body"].") + to_chat(user, "There is no exposed flesh or thin material on [p_their()] [the_part.name].") /mob/living/carbon/human/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) if(judgement_criteria & JUDGE_EMAGGED)