Stop spraying yourself (#7667)

Fixes #7666
Since you can spray people and objects, it would spray your coat (and therefore you) if you clicked on it.
Added a check to make sure the thing you're spraying isn't on your person.

Removed redundant safety checks for pepperspray.
This commit is contained in:
Doxxmedearly
2019-12-13 08:24:45 -06:00
committed by Erki
parent e7a162d43f
commit 1d35f2ec00
2 changed files with 11 additions and 6 deletions

View File

@@ -77,6 +77,8 @@
return
/obj/item/reagent_containers/spray/proc/Spray_at(atom/A as mob|obj, mob/user as mob, proximity)
if(istype(A, /obj) && A.loc == user)
return
if (A.density && proximity)
A.visible_message("[user] sprays [A] with [src].")
reagents.splash(A, amount_per_transfer_from_this)
@@ -167,12 +169,6 @@
to_chat(user, "<span class = 'notice'>You switch the safety [safety ? "on" : "off"].</span>")
playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1)
/obj/item/reagent_containers/spray/pepper/Spray_at(atom/A as mob|obj, mob/user)
if(safety)
to_chat(user, "<span class = 'warning'>The safety is on!</span>")
return
..()
/obj/item/reagent_containers/spray/waterflower
name = "water flower"
desc = "A seemingly innocent sunflower...with a twist."