add null check (#25834)

This commit is contained in:
BiancaWilkson
2024-06-06 17:28:44 -04:00
committed by GitHub
parent e22e3f9ff1
commit 8ce12e7838
@@ -36,9 +36,10 @@
return
var/mob/living/carbon/human/H = M
if(HAS_TRAIT(H.wear_suit, TRAIT_HYPOSPRAY_IMMUNE) && !ignore_hypospray_immunity) // This check is here entirely to stop goobers injecting nukies with meme chems
to_chat(user, "<span class='warning'>[src] is unable to penetrate the armour of [M] or interface with any injection ports.</span>")
return
if(H.wear_suit)
if(HAS_TRAIT(H.wear_suit, TRAIT_HYPOSPRAY_IMMUNE) && !ignore_hypospray_immunity) // This check is here entirely to stop goobers injecting nukies with meme chems
to_chat(user, "<span class='warning'>[src] is unable to penetrate the armour of [M] or interface with any injection ports.</span>")
return
if(reagents.total_volume && (can_pierce_hardsuits || M.can_inject(user, TRUE))) // can_pierce_hardsuits should be checked first or there will be an error message.
to_chat(M, "<span class='warning'>You feel a tiny prick!</span>")