mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Pipe network datum Destroy() cleanup
* Every pipe in a pipeline has a reference to the pipeline. This needs to be cleared, both so the pipeline can be gc'd, and also so the pipes don't try and keep using the qdel'd pipeline. * Same story for each pipeline in a pipe network, and each machine in a pipe network. * Pipe networks are also in the pipe_networks global list. While the controller would detect and remove it from the list on the next tick, cleaning up ourselves is the responsible thing to do.
This commit is contained in:
@@ -16,6 +16,15 @@ datum/pipe_network
|
||||
|
||||
..()
|
||||
|
||||
Destroy()
|
||||
pipe_networks -= src
|
||||
for(var/datum/pipeline/line_member in line_members)
|
||||
line_member.network = null
|
||||
for(var/obj/machinery/atmospherics/normal_member in normal_members)
|
||||
normal_member.reassign_network(src, null)
|
||||
gases.Cut() // Do not qdel the gases, we don't own them
|
||||
return ..()
|
||||
|
||||
proc/process()
|
||||
//Equalize gases amongst pipe if called for
|
||||
if(update)
|
||||
|
||||
@@ -14,6 +14,8 @@ datum/pipeline
|
||||
|
||||
if(air && air.volume)
|
||||
temporarily_store_air()
|
||||
for(var/obj/machinery/atmospherics/pipe/P in members)
|
||||
P.parent = null
|
||||
|
||||
. = ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user