From ad64c8d07791865581e92cb427f47d52fa23055d Mon Sep 17 00:00:00 2001
From: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Date: Mon, 8 Sep 2025 18:16:01 +0100
Subject: [PATCH] Fixes using syndie graffiti spray/crayon writing while zero
grav drifting (#92742)
## About The Pull Request
Fixes #92583
Does a check at the end of the spraying to see if player is still
adjacent to the item, specifically to deal with low gravity.
Also discovered Crayons have this issue too so fixed that
| During Gravity Drift| Check Failed | After Gravity Drift |
|--------|--------|--------|
|
|
|
|
## Why It's Good For The Game
- Quick fix to an issue
- No performance overhead as as check only happens after finish
spraying/drawing
---
code/game/objects/items/crayons.dm | 9 ++++++++-
code/game/objects/items/syndie_spraycan.dm | 9 ++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index 3c876f22b22..220e22f8ade 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -528,7 +528,7 @@
if(istagger)
wait_time *= 0.5
- if(!instant && !do_after(user, wait_time, target = target, max_interact_count = 4))
+ if(!instant && !do_after(user, wait_time, target = target, max_interact_count = 4, extra_checks = CALLBACK(src, PROC_REF(adjacency_check), user, target)))
return ITEM_INTERACT_BLOCKING
if(!use_charges(user, cost))
@@ -585,6 +585,13 @@
check_empty(user)
return ITEM_INTERACT_SUCCESS
+///Checks if the user is still adjacent to the target (used for do_after extra_checks)
+/obj/item/toy/crayon/proc/adjacency_check(mob/user, atom/target)
+ if(!user.Adjacent(target))
+ user.balloon_alert(user, "moved too far away!")
+ return FALSE
+ return TRUE
+
/obj/item/toy/crayon/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
if (!check_allowed_items(interacting_with))
return NONE
diff --git a/code/game/objects/items/syndie_spraycan.dm b/code/game/objects/items/syndie_spraycan.dm
index 427cc87b657..13ae3097ebf 100644
--- a/code/game/objects/items/syndie_spraycan.dm
+++ b/code/game/objects/items/syndie_spraycan.dm
@@ -85,7 +85,7 @@
if(HAS_TRAIT(user, TRAIT_TAGGER))
wait_time *= 0.5
- if(!do_after(user, wait_time, target, hidden = TRUE))
+ if(!do_after(user, wait_time, target, hidden = TRUE, extra_checks = CALLBACK(src, PROC_REF(adjacency_check), user, target)))
user.balloon_alert(user, "interrupted!")
drawing_rune = FALSE
return FALSE
@@ -146,6 +146,13 @@
suicider.AddComponent(/datum/component/face_decal, "spray", EXTERNAL_ADJACENT, paint_color)
return OXYLOSS
+///Checks if the user is still adjacent to the target (used for do_after extra_checks)
+/obj/item/traitor_spraycan/proc/adjacency_check(mob/user, atom/target)
+ if(!user.Adjacent(target))
+ user.balloon_alert(user, "moved too far away!")
+ return FALSE
+ return TRUE
+
/obj/effect/decal/cleanable/traitor_rune
name = "syndicate graffiti"
desc = "It looks like it's going to be... the Syndicate logo?"