From c190f9d44f68cabc3774701ac87478d4ef3e9576 Mon Sep 17 00:00:00 2001 From: Bloop <13398309+vinylspiders@users.noreply.github.com> Date: Thu, 25 Jan 2024 20:23:24 -0500 Subject: [PATCH] Fixes a decal hard del (#81093) ## About The Pull Request Attempting to fix this hard del here: ![firefox_1QHRZHx9GY](https://github.com/tgstation/tgstation/assets/13398309/871d50e4-1bfc-4b16-82af-972162e8d2e4) I think the cause is from the turf changing, which `/datum/elements/connect_loc` does not seem to take into consideration. Now it should. Also cleans up the signals in `/datum/component/infective/` which may be another potential cause of issues. ## Why It's Good For The Game Code that cleans up after itself is nice. ## Changelog :cl: fix: fixes a hard del with decals /:cl: --- code/datums/components/infective.dm | 17 +++++++++++++++++ code/datums/elements/connect_loc.dm | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/code/datums/components/infective.dm b/code/datums/components/infective.dm index 6d89f6e5cd9..97df6342aeb 100644 --- a/code/datums/components/infective.dm +++ b/code/datums/components/infective.dm @@ -161,3 +161,20 @@ /datum/component/infective/proc/try_infect(mob/living/L, target_zone) for(var/V in diseases) L.ContactContractDisease(V, target_zone) + +/datum/component/infective/UnregisterFromParent() + . = ..() + UnregisterSignal(parent, list( + COMSIG_FOOD_EATEN, + COMSIG_PILL_CONSUMED, + COMSIG_COMPONENT_CLEAN_ACT, + COMSIG_MOVABLE_BUMP, + COMSIG_MOVABLE_IMPACT_ZONE, + COMSIG_ITEM_ATTACK_ZONE, + COMSIG_ITEM_ATTACK, + COMSIG_ITEM_EQUIPPED, + COMSIG_GLASS_DRANK, + COMSIG_ORGAN_IMPLANTED, + COMSIG_GIBS_STREAK, + )) + qdel(GetComponent(/datum/component/connect_loc_behalf)) diff --git a/code/datums/elements/connect_loc.dm b/code/datums/elements/connect_loc.dm index 32b3b50b783..2e34d1d37b9 100644 --- a/code/datums/elements/connect_loc.dm +++ b/code/datums/elements/connect_loc.dm @@ -24,7 +24,7 @@ /datum/element/connect_loc/proc/update_signals(atom/movable/listener) var/atom/listener_loc = listener.loc - if(isnull(listener_loc)) + if(QDELETED(listener) || QDELETED(listener_loc)) return for (var/signal in connections)