From 7553355ecd337dd719de70c25c2cc9b4e79c5e6f Mon Sep 17 00:00:00 2001 From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Date: Tue, 25 May 2021 23:54:49 -0700 Subject: [PATCH] Prevents a forced qdel from fucking with things that expect more then one arg from Detach() (#59303) --- code/datums/elements/_element.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/datums/elements/_element.dm b/code/datums/elements/_element.dm index 6539a67ed88..30bd98a3268 100644 --- a/code/datums/elements/_element.dm +++ b/code/datums/elements/_element.dm @@ -23,7 +23,11 @@ return ELEMENT_INCOMPATIBLE SEND_SIGNAL(target, COMSIG_ELEMENT_ATTACH, src) if(element_flags & ELEMENT_DETACH) - RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/Detach, override = TRUE) + RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/OnTargetDelete, override = TRUE) + +/datum/element/proc/OnTargetDelete(datum/source, force) + SIGNAL_HANDLER + Detach(source) /// Deactivates the functionality defines by the element on the given datum /datum/element/proc/Detach(datum/source, ...)