From c8004a088e72b3aedd2569faf46ebd56a38b8b29 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 19 Mar 2018 21:16:00 -0500 Subject: [PATCH] [MIRROR] Crayons and spraycans can no longer infinitely draw large graffiti (#6001) * Crayons and spraycans can no longer infinitely draw large graffiti (#36412) :cl: SailorDave fix: Crayons and spraycans can no longer draw an unlimited amount of large graffiti regardless of uses left. /:cl: 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 --- code/game/objects/items/crayons.dm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 428412e11a..0abdc9a7c4 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -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("You hear spraying.") 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