mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-13 08:56:49 +01:00
Fix Shutters Bug (#21947)
Fixes the shutters bug by reverting back to the original version of turf_hand_component
This commit is contained in:
@@ -1,34 +1,19 @@
|
||||
/**
|
||||
* 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
|
||||
/*
|
||||
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
|
||||
|
||||
When multiple of these components are in the tile, the one with the highest priority wins it.
|
||||
*/
|
||||
/datum/component/turf_hand
|
||||
var/priority = 1
|
||||
var/atom/our_owner
|
||||
|
||||
/datum/component/turf_hand/Initialize()
|
||||
. = ..()
|
||||
if (!parent)
|
||||
return
|
||||
/datum/component/turf_hand/Initialize(var/priority = 1)
|
||||
..()
|
||||
if(isatom(parent))
|
||||
our_owner = parent
|
||||
src.priority = priority
|
||||
|
||||
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)
|
||||
/datum/component/turf_hand/proc/OnHandInterception(var/mob/user)
|
||||
return our_owner.attack_hand(user)
|
||||
|
||||
Reference in New Issue
Block a user