mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 21:10:30 +01:00
8998842f7a
I spent the entirety of today's event looking at hard dels with my new digital minions. This was *nearly* every Hard Del that came up during 2/7/2026's event. It turns out that AI is extremely well suited to hunting down circular references like this across an entire repo. This PR was made with Antigravity-Gemini3Pro. I have not yet tested this PR. --------- Signed-off-by: VMSolidus <evilexecutive@gmail.com> Co-authored-by: Wildkins <john.wildkins@gmail.com>
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
/**
|
|
* This component is used on airlocks and cult runes.
|
|
* When a mob [attack_hand]s a turf, it will look for objects in itself containing this component.
|
|
* If such is found, it will call attack_hand on that atom
|
|
*/
|
|
#define TURF_HAND_COMPONENT /datum/component/turf_hand
|
|
/datum/component/turf_hand
|
|
|
|
/datum/component/turf_hand/Initialize()
|
|
. = ..()
|
|
if (!parent)
|
|
return
|
|
|
|
RegisterSignal(parent, COMSIG_HANDLE_HAND_INTERCEPTION, PROC_REF(OnHandInterception), override = TRUE)
|
|
|
|
/datum/component/turf_hand/Destroy()
|
|
if (parent)
|
|
UnregisterSignal(parent, COMSIG_HANDLE_HAND_INTERCEPTION)
|
|
|
|
return ..()
|
|
|
|
/datum/component/turf_hand/proc/OnHandInterception(var/atom/origin, var/mob/attacker, var/turf/turf)
|
|
// SIGNAL_HANDLER
|
|
// For the record you shouldn't comment out SIGNAL_HANDLER on signals for your code.
|
|
// But StrongDMM doesn't care that I'm calling a proc on ASYNC.
|
|
if (!isatom(parent))
|
|
qdel(src) // Invalid parent. Make the component kill itself.
|
|
return
|
|
|
|
if (!attacker)
|
|
return
|
|
|
|
var/atom/owner = parent
|
|
INVOKE_ASYNC(owner, TYPE_PROC_REF(/atom, attack_hand), attacker)
|