Skip to content

Commit 0ee2d9f

Browse files
Sprok0Probe1
authored andcommitted
improves check_body_part_coverage(), makes it easier to splash grays (#13288)
1 parent 4a5a933 commit 0ee2d9f

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

code/modules/mob/living/carbon/human/human_defense.dm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,14 @@ emp_act
7676
/mob/living/carbon/human/proc/check_body_part_coverage(var/body_part_flags=0)
7777
if(!body_part_flags)
7878
return 0
79+
var/parts_to_check = body_part_flags
7980
for(var/obj/item/clothing/C in get_clothing_items())
8081
if(!C)
8182
continue
82-
if(C.body_parts_covered & body_part_flags)
83+
if((C.body_parts_covered & body_part_flags) == body_part_flags)
84+
return 1
85+
parts_to_check &= ~(C.body_parts_covered)
86+
if(!parts_to_check)
8387
return 1
8488
return 0
8589

code/modules/reagents/Chemistry-Reagents.dm

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,11 @@
376376
//Greys treat water like acid
377377
if(ishuman(M))
378378
var/mob/living/carbon/human/H = M
379-
if(H.species.name == "Grey")
379+
if(isgrey(H))
380380
if(method == TOUCH)
381381

382-
if(H.wear_mask)
383-
to_chat(H, "<span class='warning'>Your mask protects you from the water!</span>")
384-
return
385-
386-
if(H.head)
387-
to_chat(H, "<span class='warning'>Your helmet protects you from the water!</span>")
382+
if(H.check_body_part_coverage(EYES|MOUTH))
383+
to_chat(H, "<span class='warning'>Your face is protected from a splash of water!</span>")
388384
return
389385

390386
if(M.acidable())

0 commit comments

Comments
 (0)