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 |
|--------|--------|--------|
| <img width="429" height="515" alt="image"
src="https://github.com/user-attachments/assets/5ed4216c-e656-4601-ac1e-86d177305483"
/> | <img width="260" height="137" alt="image"
src="https://github.com/user-attachments/assets/06e2bba2-848b-418e-910c-661b891951ad"
/>| <img width="436" height="523" alt="image"
src="https://github.com/user-attachments/assets/338baf15-1658-402c-b4fd-eacf278d8be7"
/> |
## Why It's Good For The Game

- Quick fix to an issue
- No performance overhead as as check only happens after finish
spraying/drawing
This commit is contained in:
SimplyLogan
2025-09-08 18:16:01 +01:00
committed by GitHub
parent a363eece32
commit ad64c8d077
2 changed files with 16 additions and 2 deletions
+8 -1
View File
@@ -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
+8 -1
View File
@@ -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?"