Files
Bubberstation/code/datums/elements/force_move_pulled.dm
T
MrMelbert a0b271d336 Fix Flypeople before anyone realizes they're broken but me (#94264)
## About The Pull Request

After I merged #94200 I realized it blocked all attack hand interactions
on decal which means flypeople would break

Fixes that, adds some unit tests

## Changelog

🆑 Melbert
fix: Fix Flypeople's vomit interaction before anyone realizes it's
broken but me
/🆑
2025-12-02 17:07:20 -07:00

21 lines
702 B
Plaintext

/// Click dragging (thing) will force move (thing). A good use-case example for this would be clicking on a tile with a blood decal.
/datum/element/force_move_pulled
/datum/element/force_move_pulled/Attach(datum/target)
if(!isatom(target))
return ELEMENT_INCOMPATIBLE
. = ..()
RegisterSignal(target, COMSIG_ATOM_ATTACK_HAND, PROC_REF(on_click), override = TRUE)
/datum/element/force_move_pulled/Detach(datum/target)
. = ..()
UnregisterSignal(target, COMSIG_ATOM_ATTACK_HAND)
/datum/element/force_move_pulled/proc/on_click(atom/moving_atom, mob/user, list/modifiers)
SIGNAL_HANDLER
if(isnull(user.pulling))
return NONE
user.Move_Pulled(moving_atom)
return COMPONENT_CANCEL_ATTACK_CHAIN