diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 132dc41a595..8957e46f485 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -36,6 +36,10 @@ Pipelines + Other Objects -> Pipe network stored = new(src, make_from=src) /obj/machinery/atmospherics/Destroy() + for(DEVICE_TYPE_LOOP) + if(NODE_I) + nullifyNode(I) + SSair.atmos_machinery -= src if(stored) qdel(stored) @@ -49,6 +53,13 @@ Pipelines + Other Objects -> Pipe network ..() +/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 @@ -106,11 +117,15 @@ Pipelines + Other Objects -> Pipe network /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]" update_icon() /obj/machinery/atmospherics/update_icon() diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index c4f3073e767..3218246eb90 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -29,6 +29,8 @@ Thus, the two variables affect pump operation are set in New(): /obj/machinery/atmospherics/components/binary/pump/Destroy() if(radio_controller) radio_controller.remove_object(src,frequency) + if(radio_connection) + radio_connection = null ..() /obj/machinery/atmospherics/components/binary/pump/on diff --git a/code/ATMOSPHERICS/components/components_base.dm b/code/ATMOSPHERICS/components/components_base.dm index 1414cd8f742..f60f3af95d9 100644 --- a/code/ATMOSPHERICS/components/components_base.dm +++ b/code/ATMOSPHERICS/components/components_base.dm @@ -23,11 +23,11 @@ On top of that, now people can add component-speciic procs/vars if they want! Iconnery */ -/obj/machinery/atmospherics/components/proc/icon_addintact(var/obj/machinery/atmospherics/node, var/connected = 0) +/obj/machinery/atmospherics/components/proc/icon_addintact(var/obj/machinery/atmospherics/node) var/image/img = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', "pipe_intact", get_dir(src,node), node.pipe_color) underlays += img - return connected | img.dir + return img.dir /obj/machinery/atmospherics/components/proc/icon_addbroken(var/connected = 0) var/unconnected = (~connected) & initialize_directions @@ -56,7 +56,7 @@ Iconnery for(DEVICE_TYPE_LOOP) //adds intact pieces if(NODE_I) - connected = icon_addintact(NODE_I, connected) + connected |= icon_addintact(NODE_I) icon_addbroken(connected) //adds broken pieces @@ -64,17 +64,12 @@ Iconnery /* Pipenet stuff; housekeeping */ -/obj/machinery/atmospherics/components/Destroy() - for(DEVICE_TYPE_LOOP) - var/obj/machinery/atmospherics/N = NODE_I - if(N) - N.disconnect(src) - NODE_I = null - nullifyPipenet(PARENT_I) + +/obj/machinery/atmospherics/components/nullifyNode(I) ..() - - - + nullifyPipenet(PARENT_I) + qdel(AIR_I) + AIR_I = null /obj/machinery/atmospherics/components/construction() ..() @@ -93,6 +88,7 @@ Pipenet stuff; housekeeping 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/returnPipenetAir(datum/pipeline/reference) diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm index 94d28113548..af4234cf1da 100644 --- a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm @@ -59,6 +59,12 @@ /obj/machinery/atmospherics/components/unary/vent_pump/Destroy() if(radio_controller) radio_controller.remove_object(src,frequency) + if(radio_connection) + radio_connection = null + if(initial_loc) + initial_loc.air_vent_info -= id_tag + initial_loc.air_vent_names -= id_tag + initial_loc = null ..() /obj/machinery/atmospherics/components/unary/vent_pump/high_volume diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm index e4f6e606364..568286d3230 100644 --- a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm @@ -48,9 +48,14 @@ /obj/machinery/atmospherics/components/unary/vent_scrubber/Destroy() if(radio_controller) radio_controller.remove_object(src,frequency) + if(radio_connection) + radio_connection = null if(initial_loc) initial_loc.air_scrub_info -= id_tag initial_loc.air_scrub_names -= id_tag + initial_loc = null + for(var/I in adjacent_turfs) + I = null ..() /obj/machinery/atmospherics/components/unary/vent_scrubber/auto_use_power() if(!powered(power_channel)) diff --git a/code/ATMOSPHERICS/pipes/pipes.dm b/code/ATMOSPHERICS/pipes/pipes.dm index 4d902488520..1e3c06cf7ad 100644 --- a/code/ATMOSPHERICS/pipes/pipes.dm +++ b/code/ATMOSPHERICS/pipes/pipes.dm @@ -18,16 +18,10 @@ color = pipe_color ..() -/obj/machinery/atmospherics/pipe/Destroy() - for(DEVICE_TYPE_LOOP) - var/obj/machinery/atmospherics/N = NODE_I - if(N) - var/obj/machinery/atmospherics/oldN = N - N.disconnect(src) - NODE_I = null - oldN.build_network() - releaseAirToTurf() +/obj/machinery/atmospherics/pipe/nullifyNode(I) + var/obj/machinery/atmospherics/oldN = NODE_I ..() + oldN.build_network() /obj/machinery/atmospherics/pipe/update_icon() //overridden by manifolds if(NODE1&&NODE2) @@ -83,6 +77,10 @@ parent = P /obj/machinery/atmospherics/pipe/Destroy() + releaseAirToTurf() + qdel(air_temporary) + air_temporary = null + var/turf/T = loc for(var/obj/machinery/meter/meter in T) if(meter.target == src) diff --git a/tgstation.dme b/tgstation.dme index 0f73ac1adc9..10a7d74554f 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -312,6 +312,7 @@ #include "code\game\gamemodes\changeling\powers\absorb.dm" #include "code\game\gamemodes\changeling\powers\adrenaline.dm" #include "code\game\gamemodes\changeling\powers\augmented_eyesight.dm" +#include "code\game\gamemodes\changeling\powers\chameleon_skin.dm" #include "code\game\gamemodes\changeling\powers\digitalcamo.dm" #include "code\game\gamemodes\changeling\powers\fakedeath.dm" #include "code\game\gamemodes\changeling\powers\fleshmend.dm"