From bcaaa65e6aa54933c30f8b68e75d3bbd5a9a173f Mon Sep 17 00:00:00 2001 From: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Date: Fri, 14 May 2021 20:12:46 -0700 Subject: [PATCH] Stop singularities from consuming themselves (#58987) This bug was fixed by one of the connect_loc PRs, but this is still useful as it contains a CRASH for when it happens if this bug comes back again. --- code/datums/components/singularity.dm | 4 ++++ code/modules/power/singularity/singularity.dm | 1 + 2 files changed, 5 insertions(+) diff --git a/code/datums/components/singularity.dm b/code/datums/components/singularity.dm index c2cb875c00a..33cc1f526bc 100644 --- a/code/datums/components/singularity.dm +++ b/code/datums/components/singularity.dm @@ -130,6 +130,10 @@ return COMPONENT_CANCEL_BLOB_ACT /datum/component/singularity/proc/consume(datum/source, atom/thing) + if (thing == parent) + stack_trace("Singularity tried to consume itself.") + return + consume_callback?.Invoke(thing, src) /datum/component/singularity/proc/consume_attack(datum/source, mob/user) diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index c45542691dc..955738e8311 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -410,6 +410,7 @@ /obj/singularity/singularity_act() var/gain = (energy/2) var/dist = max((current_size - 2),1) + investigate_log("has been destroyed by another singularity.", INVESTIGATE_SINGULO) explosion(src, devastation_range = (dist), heavy_impact_range = (dist*2), light_impact_range = (dist*4)) qdel(src) return gain