From 539dc0e67b0a927712bb4147a970c0a575149179 Mon Sep 17 00:00:00 2001 From: Verkister Date: Wed, 19 Oct 2022 23:51:28 +0300 Subject: [PATCH] Fixes a bug with deleted disposal outlets Fixes deleted disposal outlets not unlinking their trunks, causing anything that the bare trunk tries to eject to runtime and get qdel'd instead. --- code/modules/recycling/disposal.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index a8766e440d..df001179f0 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -1530,6 +1530,12 @@ if(trunk) trunk.linked = src // link the pipe trunk to self +/obj/structure/disposaloutlet/Destroy() + var/obj/structure/disposalpipe/trunk/trunk = locate() in loc + if(trunk) + trunk.linked = null + return ..() + // expel the contents of the holder object, then delete it // called when the holder exits the outlet /obj/structure/disposaloutlet/proc/expel(var/obj/structure/disposalholder/H)