Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions code/game/objects/items/crayons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,8 @@
var/mob/living/carbon/human/H = user
if (HAS_TRAIT(H, TRAIT_TAGGER))
cost *= 0.5
/* yogs start -- moved to the end of the proc, after the crayon is actually used.
var/charges_used = use_charges(user, cost)
if(!charges_used)
if(check_empty(user, cost))
return
. = charges_used
yogs end */

if(istype(target, /obj/effect/decal/cleanable))
target = target.loc
Expand Down Expand Up @@ -352,6 +348,11 @@
if(!instant)
if(!do_after(user, 5 SECONDS, target))
return

var/charges_used = use_charges(user, cost)
if(!charges_used)
return
. = charges_used

if(length(text_buffer))
drawing = text_buffer[1]
Expand Down Expand Up @@ -397,12 +398,6 @@
if(post_noise)
audible_message(span_notice("You hear spraying."))
playsound(user.loc, 'sound/effects/spray.ogg', 5, 1, 5)
// yogs start -- using changes moved to the end of the proc, so it won't use charges if the spraying fails for any reason.
var/charges_used = use_charges(user, cost)
if(!charges_used)
return
. = charges_used
// yogs end
var/fraction = min(1, . / reagents.maximum_volume)
if(affected_turfs.len)
fraction /= affected_turfs.len
Expand Down