[MIRROR] Crayons and spraycans can no longer infinitely draw large graffiti (#6001)

* Crayons and spraycans can no longer infinitely draw large graffiti (#36412)

🆑 SailorDave
fix: Crayons and spraycans can no longer draw an unlimited amount of large graffiti regardless of uses left.
/🆑

Fixes https://github.com/tgstation/tgstation/issues/35833

The check_empty() at the top of the afterattack() was only checking if the can was empty, not if the amount of charges left was less than the spray amount. This is fixed.

* Crayons and spraycans can no longer infinitely draw large graffiti
This commit is contained in:
CitadelStationBot
2018-03-19 21:16:00 -05:00
committed by Poojawa
parent df15bbe0f0
commit c8004a088e
+6 -5
View File
@@ -244,8 +244,13 @@
if(!proximity || !check_allowed_items(target))
return
if(check_empty(user))
var/cost = 1
if(paint_mode == PAINT_LARGE_HORIZONTAL)
cost = 5
var/charges_used = use_charges(user, cost)
if(!charges_used)
return
. = charges_used
if(istype(target, /obj/effect/decal/cleanable))
target = target.loc
@@ -353,10 +358,6 @@
audible_message("<span class='notice'>You hear spraying.</span>")
playsound(user.loc, 'sound/effects/spray.ogg', 5, 1, 5)
var/cost = 1
if(paint_mode == PAINT_LARGE_HORIZONTAL)
cost = 5
. = use_charges(user, cost)
var/fraction = min(1, . / reagents.maximum_volume)
if(affected_turfs.len)
fraction /= affected_turfs.len