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
🆑
fix: lathes don't break on ore silo deletion
/🆑
This commit is contained in:
SyncIt21
2025-06-15 15:52:14 -04:00
committed by Roxy
parent 314210b24c
commit c780349b12
2 changed files with 6 additions and 11 deletions
@@ -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))