mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-18 10:34:10 +01:00
More Destroy()s, better implementation
- Re-implements Destroy() for SMES units. This time moves relevant (de)construction code all the way up to obj/machinery/. This should fix any potential GC issues with deconstruction of component-based machines. - Implements Destroy() for breaker boxes. - Fixes SMES units lacking disconnect_terminal(), causing GC errors.
This commit is contained in:
@@ -19,6 +19,11 @@
|
||||
var/RCon_tag = "NO_TAG"
|
||||
var/update_locked = 0
|
||||
|
||||
/obj/machinery/power/breakerbox/Destroy()
|
||||
..()
|
||||
for(var/obj/nano_module/rcon/R in world)
|
||||
R.FindDevices()
|
||||
|
||||
/obj/machinery/power/breakerbox/activated
|
||||
icon_state = "bbox_on"
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
/obj/machinery/power/Destroy()
|
||||
disconnect_from_network()
|
||||
disconnect_terminal()
|
||||
|
||||
..()
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
@@ -84,10 +84,12 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/smes/Destroy()
|
||||
/obj/machinery/power/smes/disconnect_terminal()
|
||||
if(terminal)
|
||||
disconnect_terminal()
|
||||
..()
|
||||
terminal.master = null
|
||||
terminal = null
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/power/smes/update_icon()
|
||||
overlays.Cut()
|
||||
|
||||
@@ -76,12 +76,10 @@
|
||||
should_be_mapped = 1
|
||||
|
||||
/obj/machinery/power/smes/buildable/Destroy()
|
||||
..()
|
||||
qdel(wires)
|
||||
if(component_parts)
|
||||
for(var/atom/A in component_parts)
|
||||
qdel(A)
|
||||
|
||||
return ..()
|
||||
for(var/obj/nano_module/rcon/R in world)
|
||||
R.FindDevices()
|
||||
|
||||
|
||||
// Proc: process()
|
||||
@@ -354,6 +352,7 @@
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
component_parts -= I
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user