mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Makes pipes garbage collect gracefully
This commit is contained in:
@@ -51,16 +51,14 @@ Pipelines + Other Objects -> Pipe network
|
||||
if(pipe_vision_img)
|
||||
qdel(pipe_vision_img)
|
||||
|
||||
..()
|
||||
return QDEL_HINT_FINDREFERENCE
|
||||
return ..()
|
||||
//return QDEL_HINT_FINDREFERENCE
|
||||
|
||||
/obj/machinery/atmospherics/proc/nullifyNode(I)
|
||||
var/obj/machinery/atmospherics/N = NODE_I
|
||||
N.disconnect(src)
|
||||
NODE_I = null
|
||||
|
||||
|
||||
|
||||
//this is called just after the air controller sets up turfs
|
||||
/obj/machinery/atmospherics/proc/atmosinit(var/list/node_connects)
|
||||
if(!node_connects) //for pipes where order of nodes doesn't matter
|
||||
@@ -88,10 +86,7 @@ Pipelines + Other Objects -> Pipe network
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/proc/pipeline_expansion()
|
||||
var/list/return_nodes = list()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
return_nodes |= NODE_I
|
||||
return return_nodes
|
||||
return nodes
|
||||
|
||||
/obj/machinery/atmospherics/proc/SetInitDirections()
|
||||
return
|
||||
@@ -116,17 +111,11 @@ Pipelines + Other Objects -> Pipe network
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(reference == NODE_I)
|
||||
// world << "[reference] found in nodes of [src]"
|
||||
if(istype(NODE_I, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/P = NODE_I
|
||||
qdel(P.parent)
|
||||
// world << "[reference] has qdel'd its parent"
|
||||
NODE_I = null
|
||||
// world << "NODE[I]: [NODE_I]"
|
||||
break
|
||||
//world << "[reference] not yet disconnected from [src]"
|
||||
if(istype(reference, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/P = reference
|
||||
qdel(P.parent)
|
||||
var/I = nodes.Find(reference)
|
||||
NODE_I = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/update_icon()
|
||||
@@ -192,9 +181,6 @@ Pipelines + Other Objects -> Pipe network
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/atmospherics/proc/nullifyPipenet(datum/pipeline/P)
|
||||
P.other_atmosmch -= src
|
||||
|
||||
/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255))
|
||||
|
||||
//Add identifiers for the iconset
|
||||
|
||||
@@ -66,7 +66,7 @@ Pipenet stuff; housekeeping
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/nullifyNode(I)
|
||||
return ..()
|
||||
..()
|
||||
nullifyPipenet(PARENT_I)
|
||||
qdel(AIR_I)
|
||||
AIR_I = null
|
||||
@@ -82,43 +82,34 @@ Pipenet stuff; housekeeping
|
||||
var/datum/pipeline/P = PARENT_I
|
||||
P.build_pipeline(src)
|
||||
|
||||
/obj/machinery/atmospherics/components/nullifyPipenet(datum/pipeline/reference)
|
||||
..()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(reference == PARENT_I)
|
||||
var/datum/pipeline/P = PARENT_I
|
||||
P.other_airs -= AIR_I
|
||||
P.other_atmosmch -= src
|
||||
PARENT_I = null
|
||||
/obj/machinery/atmospherics/components/proc/nullifyPipenet(datum/pipeline/reference)
|
||||
var/I = parents.Find(reference)
|
||||
reference.other_airs -= AIR_I
|
||||
reference.other_atmosmch -= src
|
||||
PARENT_I = null
|
||||
|
||||
/obj/machinery/atmospherics/components/returnPipenetAir(datum/pipeline/reference)
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(reference == PARENT_I)
|
||||
return AIR_I
|
||||
var/I = parents.Find(reference)
|
||||
return AIR_I
|
||||
|
||||
/obj/machinery/atmospherics/components/pipeline_expansion(datum/pipeline/reference)
|
||||
if(reference)
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(PARENT_I == reference)
|
||||
return list(NODE_I)
|
||||
var/I = parents.Find(reference)
|
||||
return list(NODE_I)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/setPipenet(datum/pipeline/reference, obj/machinery/atmospherics/A)
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(A == NODE_I)
|
||||
PARENT_I = reference
|
||||
break
|
||||
var/I = nodes.Find(A)
|
||||
PARENT_I = reference
|
||||
|
||||
/obj/machinery/atmospherics/components/returnPipenet(obj/machinery/atmospherics/A = NODE1) //returns PARENT1 if called without argument
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(A == NODE_I)
|
||||
return PARENT_I
|
||||
var/I = nodes.Find(A)
|
||||
return PARENT_I
|
||||
|
||||
/obj/machinery/atmospherics/components/replacePipenet(datum/pipeline/Old, datum/pipeline/New)
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(PARENT_I == Old)
|
||||
PARENT_I = New
|
||||
var/I = parents.Find(Old)
|
||||
PARENT_I = New
|
||||
|
||||
/obj/machinery/atmospherics/components/unsafe_pressure_release(var/mob/user, var/pressures)
|
||||
..()
|
||||
|
||||
@@ -59,8 +59,7 @@
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
if(radio_connection)
|
||||
radio_connection = null
|
||||
radio_connection = null
|
||||
if(initial_loc)
|
||||
initial_loc.air_vent_info -= id_tag
|
||||
initial_loc.air_vent_names -= id_tag
|
||||
|
||||
@@ -48,8 +48,7 @@
|
||||
/obj/machinery/atmospherics/components/unary/vent_scrubber/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
if(radio_connection)
|
||||
radio_connection = null
|
||||
radio_connection = null
|
||||
if(initial_loc)
|
||||
initial_loc.air_scrub_info -= id_tag
|
||||
initial_loc.air_scrub_names -= id_tag
|
||||
|
||||
@@ -81,6 +81,9 @@
|
||||
qdel(air_temporary)
|
||||
air_temporary = null
|
||||
|
||||
if(parent)
|
||||
parent.members -= src
|
||||
|
||||
var/turf/T = loc
|
||||
for(var/obj/machinery/meter/meter in T)
|
||||
if(meter.target == src)
|
||||
|
||||
Reference in New Issue
Block a user