From c780349b121f613f18ea420c33dffeb71edf6238 Mon Sep 17 00:00:00 2001 From: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Date: Sun, 8 Jun 2025 20:13:04 +0530 Subject: [PATCH] Fixes lathes breaking on ore silo deletion (#91498) ## About The Pull Request - Fixes #91494 - Fixes #91479 - Fixes #90533 The ORM disconnects the machines from its `Destroy()` proc by which time its deleted flag has already been set to TRUE leading to an early return, thus causing the silo to not disconnect properly ## Changelog :cl: fix: lathes don't break on ore silo deletion /:cl: --- code/datums/components/material/remote_materials.dm | 13 ++++--------- code/modules/mining/machine_silo.dm | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/code/datums/components/material/remote_materials.dm b/code/datums/components/material/remote_materials.dm index 9f23de90d34..b74347cf6a0 100644 --- a/code/datums/components/material/remote_materials.dm +++ b/code/datums/components/material/remote_materials.dm @@ -75,7 +75,7 @@ handles linking back and forth. /datum/component/remote_materials/Destroy() if(silo) allow_standalone = FALSE - disconnect_from(silo) + disconnect() mat_container = null return ..() @@ -115,14 +115,9 @@ handles linking back and forth. if (!silo && mat_container) mat_container.max_amount = size -/** - * Disconnect this component from the remote silo - * - * Arguments - * old_silo- The silo we are trying to disconnect from - */ -/datum/component/remote_materials/proc/disconnect_from(obj/machinery/ore_silo/old_silo) - if (QDELETED(old_silo) || silo != old_silo) +///Disconnects this component from the silo +/datum/component/remote_materials/proc/disconnect() + if(isnull(silo)) return UnregisterSignal(parent, list(COMSIG_ATOM_ITEM_INTERACTION, COMSIG_ATOM_ITEM_INTERACTION_SECONDARY)) diff --git a/code/modules/mining/machine_silo.dm b/code/modules/mining/machine_silo.dm index 9756935b96c..1c376172e65 100644 --- a/code/modules/mining/machine_silo.dm +++ b/code/modules/mining/machine_silo.dm @@ -38,7 +38,7 @@ GLOB.ore_silo_default = null for(var/datum/component/remote_materials/mats as anything in ore_connected_machines) - mats.disconnect_from(src) + mats.disconnect() ore_connected_machines = null materials = null @@ -162,7 +162,7 @@ if(isnull(remote)) return - remote.disconnect_from(src) + remote.disconnect() return TRUE if("hold")