[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 <rohesie@gmail.com>
This commit is contained in:
SkyratBot
2020-10-04 23:36:30 +02:00
committed by GitHub
co-authored by Rohesie
parent 3420a6f427
commit 391cb8cb28
+8 -14
View File
@@ -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, "<span class='alert'>There is no exposed flesh or thin material [above_neck(target_zone) ? "on [p_their()] head" : "on [p_their()] body"].</span>")
to_chat(user, "<span class='alert'>There is no exposed flesh or thin material on [p_their()] [the_part.name].</span>")
/mob/living/carbon/human/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null)
if(judgement_criteria & JUDGE_EMAGGED)