diff --git a/_maps/map_files/MiniStation/MiniStation.dmm b/_maps/map_files/MiniStation/MiniStation.dmm
index 980025226bb..702ab5ca619 100644
--- a/_maps/map_files/MiniStation/MiniStation.dmm
+++ b/_maps/map_files/MiniStation/MiniStation.dmm
@@ -1080,7 +1080,7 @@
"uN" = (/obj/machinery/atmospherics/pipe/simple/cyan/visible{tag = "icon-intact (NORTH)"; icon_state = "intact"; dir = 1},/obj/effect/spawner/structure/window/reinforced,/turf/simulated/floor/plating,/area/engine/engineering)
"uO" = (/obj/machinery/door/airlock/external{name = "Arrival Airlock"},/turf/simulated/floor/plating,/area/hallway/secondary/entry)
"uP" = (/obj/machinery/atmospherics/pipe/simple/yellow/visible{tag = "icon-intact (NORTH)"; icon_state = "intact"; dir = 1},/obj/effect/spawner/structure/window/reinforced,/turf/simulated/floor/plating,/area/engine/engineering)
-"uQ" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction{dir = 8},/obj/effect/spawner/structure/window/reinforced,/turf/simulated/floor/plating,/area/engine/engineering)
+"uQ" = (/obj/machinery/atmospherics/pipe/heat_exchanging/junction{dir = 8},/obj/effect/spawner/structure/window/reinforced,/turf/simulated/floor/plating,/area/engine/engineering)
"uR" = (/obj/effect/spawner/structure/window/reinforced,/turf/simulated/floor/plating,/area/tcommsat/computer)
"uS" = (/obj/machinery/alarm{dir = 4; icon_state = "alarm0"; pixel_x = -22},/obj/structure/closet/secure_closet/hop,/turf/simulated/floor/plasteel,/area/crew_quarters/heads{name = "\improper Job Assignment"})
"uT" = (/obj/item/device/radio/intercom{broadcasting = 0; freerange = 0; listening = 1; name = "Common Channel"; pixel_y = 25},/obj/structure/closet/radiation,/turf/simulated/floor/plasteel,/area/engine/engineering)
@@ -1470,10 +1470,10 @@
"CI" = (/obj/machinery/atmospherics/components/unary/outlet_injector{dir = 8; frequency = 1443; id = "air_in"; on = 1},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
"CJ" = (/obj/structure/sign/fire,/turf/simulated/wall,/area/engine/engineering)
"CK" = (/obj/structure/transit_tube{tag = "icon-N-S-Pass"; icon_state = "N-S-Pass"},/turf/space,/area/space)
-"CL" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 6},/obj/structure/lattice,/turf/space,/area/engine/engineering)
-"CM" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 4},/obj/structure/lattice,/obj/machinery/light/small{dir = 1},/turf/space,/area/engine/engineering)
-"CN" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 4},/obj/structure/lattice,/turf/space,/area/engine/engineering)
-"CO" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 10},/obj/structure/lattice,/turf/space,/area/engine/engineering)
+"CL" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 6},/obj/structure/lattice,/turf/space,/area/engine/engineering)
+"CM" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 4},/obj/structure/lattice,/obj/machinery/light/small{dir = 1},/turf/space,/area/engine/engineering)
+"CN" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 4},/obj/structure/lattice,/turf/space,/area/engine/engineering)
+"CO" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 10},/obj/structure/lattice,/turf/space,/area/engine/engineering)
"CP" = (/obj/machinery/atmospherics/components/binary/valve,/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 8},/area/engine/engineering)
"CQ" = (/obj/machinery/atmospherics/components/binary/valve,/turf/simulated/floor/plating,/area/engine/engineering)
"CR" = (/obj/machinery/atmospherics/components/binary/pump{target_pressure = 1500},/turf/simulated/floor/plating,/area/engine/engineering)
@@ -1481,14 +1481,14 @@
"CT" = (/obj/machinery/atmospherics/components/binary/pump{dir = 1; target_pressure = 2000},/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 8},/area/engine/engineering)
"CU" = (/obj/machinery/atmospherics/components/binary/valve,/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 4},/area/engine/engineering)
"CV" = (/obj/machinery/button/door{id = "burndoor"; name = "Burn Chamber Vent Control"; pixel_x = 25; pixel_y = 5; req_access_txt = "0"},/turf/simulated/floor/plasteel,/area/engine/engineering)
-"CW" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 6},/obj/machinery/sparker{id = "burnchamber"; pixel_x = -25},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
-"CX" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 4},/obj/machinery/meter/turf{pixel_y = 24},/obj/machinery/light/small{dir = 1},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
-"CY" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 4},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
-"CZ" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 4},/obj/machinery/camera{c_tag = "Burn Chamber"; network = list("burnchamber")},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
-"Da" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 10},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
+"CW" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 6},/obj/machinery/sparker{id = "burnchamber"; pixel_x = -25},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
+"CX" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 4},/obj/machinery/meter/turf{pixel_y = 24},/obj/machinery/light/small{dir = 1},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
+"CY" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 4},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
+"CZ" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 4},/obj/machinery/camera{c_tag = "Burn Chamber"; network = list("burnchamber")},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
+"Da" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 10},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
"Db" = (/obj/structure/transit_tube{icon_state = "N-S"},/turf/space,/area/space)
-"Dc" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging,/obj/structure/lattice,/turf/space,/area/engine/engineering)
-"Dd" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 5},/obj/structure/lattice,/turf/space,/area/engine/engineering)
+"Dc" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple,/obj/structure/lattice,/turf/space,/area/engine/engineering)
+"Dd" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 5},/obj/structure/lattice,/turf/space,/area/engine/engineering)
"De" = (/obj/machinery/atmospherics/components/unary/portables_connector/visible{dir = 1},/turf/simulated/floor/plating,/area/engine/engineering)
"Df" = (/obj/machinery/light,/obj/machinery/atmospherics/components/unary/portables_connector/visible{dir = 1},/turf/simulated/floor/plating,/area/engine/engineering)
"Dg" = (/obj/structure/extinguisher_cabinet{pixel_x = 5; pixel_y = -32},/obj/machinery/atmospherics/components/unary/portables_connector/visible{dir = 1},/turf/simulated/floor/plating,/area/engine/engineering)
@@ -1498,22 +1498,22 @@
"Dk" = (/obj/structure/stool/bed/chair/office/dark{dir = 8},/obj/machinery/atmospherics/components/unary/vent_scrubber{on = 1},/turf/simulated/floor/plasteel,/area/tcommsat/computer)
"Dl" = (/obj/machinery/atmospherics/components/unary/vent_scrubber{dir = 4; on = 1},/turf/simulated/floor/plating,/area/tcommsat/computer)
"Dm" = (/obj/machinery/atmospherics/components/unary/vent_scrubber{dir = 1; on = 1},/obj/machinery/camera/autoname{dir = 8},/turf/simulated/floor/plasteel{icon_state = "dark"},/area/engine/gravity_generator)
-"Dn" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction{dir = 4},/turf/simulated/wall,/area/engine/engineering)
-"Do" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 9},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
-"Dp" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 6},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
-"Dq" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging,/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
+"Dn" = (/obj/machinery/atmospherics/pipe/heat_exchanging/junction{dir = 4},/turf/simulated/wall,/area/engine/engineering)
+"Do" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 9},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
+"Dp" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 6},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
+"Dq" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple,/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
"Dr" = (/obj/machinery/door/poddoor{id = "burndoor"; name = "Mixer Room Vent"},/turf/simulated/floor/plating/airless,/area/engine/engineering)
"Dt" = (/obj/structure/stool/bed/chair/office/dark{dir = 8},/obj/machinery/atmospherics/components/unary/vent_scrubber{dir = 1; on = 1},/turf/simulated/floor/plasteel,/area/tcommsat/computer)
"Du" = (/obj/machinery/atmospherics/components/unary/vent_pump{dir = 1; on = 1},/turf/simulated/floor/plasteel,/area/tcommsat/computer)
"Dv" = (/obj/structure/cable{d1 = 1; d2 = 8; icon_state = "1-8"},/obj/machinery/atmospherics/components/unary/vent_scrubber{dir = 1; on = 1},/turf/simulated/floor/plasteel,/area/engine/gravity_generator)
"Dw" = (/obj/item/device/analyzer,/obj/item/weapon/wrench,/turf/simulated/floor/plasteel,/area/engine/engineering)
"DG" = (/obj/machinery/atmospherics/components/binary/volume_pump{dir = 4},/turf/simulated/floor/plating,/area/engine/engineering)
-"DL" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 9},/obj/structure/lattice,/turf/space,/area/engine/engineering)
+"DL" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 9},/obj/structure/lattice,/turf/space,/area/engine/engineering)
"DP" = (/obj/machinery/alarm{dir = 1; icon_state = "alarm0"; pixel_y = -22},/obj/machinery/camera/autoname{dir = 1},/obj/item/device/flashlight{pixel_x = 1; pixel_y = 5},/turf/simulated/floor/plating,/area/engine/engineering)
"DS" = (/obj/machinery/computer/security/telescreen{desc = "Used for watching the burn chamber."; dir = 8; layer = 4; name = "Burn Chamber Telescreen"; network = list("burnchamber"); pixel_x = 0; pixel_y = -30},/obj/structure/stool,/turf/simulated/floor/plating,/area/engine/engineering)
"DT" = (/obj/machinery/light,/turf/simulated/floor/plating,/area/engine/engineering)
"DU" = (/obj/machinery/button/ignition{id = "burnchamber"; pixel_x = 25},/turf/simulated/floor/plating,/area/engine/engineering)
-"DW" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 5},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
+"DW" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 5},/turf/simulated/floor/engine/vacuum,/area/engine/engineering)
"DX" = (/obj/structure/transit_tube{icon_state = "N-S"},/obj/structure/lattice,/turf/space,/area/space)
"DZ" = (/obj/structure/lattice,/obj/structure/transit_tube{tag = "icon-N-S-Pass"; icon_state = "N-S-Pass"},/turf/space,/area/space)
"Ea" = (/turf/simulated/wall,/area/tcommsat/computer)
diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm
index 5fcd9bf7266..d8475939dae 100644
--- a/code/ATMOSPHERICS/atmospherics.dm
+++ b/code/ATMOSPHERICS/atmospherics.dm
@@ -9,7 +9,6 @@ Pipes -> Pipelines
Pipelines + Other Objects -> Pipe network
*/
-
/obj/machinery/atmospherics
anchored = 1
idle_power_usage = 0
@@ -25,14 +24,21 @@ Pipelines + Other Objects -> Pipe network
var/image/pipe_vision_img = null
+ var/device_type = 0
+ var/list/obj/machinery/atmospherics/nodes = list()
+
/obj/machinery/atmospherics/New()
..()
+ nodes.len = device_type
SSair.atmos_machinery += src
SetInitDirections()
if(can_unwrench)
stored = new(src, make_from=src)
/obj/machinery/atmospherics/Destroy()
+ for(DEVICE_TYPE_LOOP)
+ nullifyNode(I)
+
SSair.atmos_machinery -= src
if(stored)
qdel(stored)
@@ -45,10 +51,42 @@ Pipelines + Other Objects -> Pipe network
qdel(pipe_vision_img)
return ..()
+ //return QDEL_HINT_FINDREFERENCE
+
+/obj/machinery/atmospherics/proc/nullifyNode(I)
+ if(NODE_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()
- return
+/obj/machinery/atmospherics/proc/atmosinit(var/list/node_connects)
+ if(!node_connects) //for pipes where order of nodes doesn't matter
+ node_connects = list()
+ node_connects.len = device_type
+
+ for(DEVICE_TYPE_LOOP)
+ for(var/D in cardinal)
+ if(D & GetInitDirections())
+ if(D in node_connects)
+ continue
+ node_connects[I] = D
+ break
+
+ for(DEVICE_TYPE_LOOP)
+ for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[I]))
+ if(can_be_node(target, I))
+ NODE_I = target
+ break
+
+ update_icon()
+
+/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target)
+ if(target.initialize_directions & get_dir(target,src))
+ return 1
+
+/obj/machinery/atmospherics/proc/pipeline_expansion()
+ return nodes
/obj/machinery/atmospherics/proc/SetInitDirections()
return
@@ -73,7 +111,12 @@ Pipelines + Other Objects -> Pipe network
return
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
- return
+ 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()
return
@@ -138,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
diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
index b6490a986f5..e4858d432e6 100644
--- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
@@ -27,10 +27,8 @@ Housekeeping and pipe network stuff
*/
/obj/machinery/atmospherics/components/binary/atmosinit()
-
var/node2_connect = dir
var/node1_connect = turn(dir, 180)
- var/list/node_connects = new/list()
- node_connects.Add(node1_connect, node2_connect)
+ var/list/node_connects = list(node1_connect, node2_connect)
..(node_connects)
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
index f5da3152aae..436725a4baf 100644
--- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
@@ -18,8 +18,8 @@
/obj/machinery/atmospherics/components/binary/circulator/proc/return_transfer_air()
- var/datum/gas_mixture/air1 = airs[AIR1]
- var/datum/gas_mixture/air2 = airs[AIR2]
+ var/datum/gas_mixture/air1 = AIR1
+ var/datum/gas_mixture/air2 = AIR2
var/output_starting_pressure = air1.return_pressure()
var/input_starting_pressure = air2.return_pressure()
diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
index 6b0719580ff..bde761f802d 100644
--- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
@@ -42,8 +42,8 @@ Acts like a normal vent, but has an input AND output.
/obj/machinery/atmospherics/components/binary/dp_vent_pump/high_volume/New()
..()
- var/datum/gas_mixture/air1 = airs[AIR1]
- var/datum/gas_mixture/air2 = airs[AIR2]
+ var/datum/gas_mixture/air1 = AIR1
+ var/datum/gas_mixture/air2 = AIR2
air1.volume = 1000
air2.volume = 1000
@@ -66,8 +66,8 @@ Acts like a normal vent, but has an input AND output.
if(!on)
return 0
- var/datum/gas_mixture/air1 = airs[AIR1]
- var/datum/gas_mixture/air2 = airs[AIR2]
+ var/datum/gas_mixture/air1 = AIR1
+ var/datum/gas_mixture/air2 = AIR2
var/datum/gas_mixture/environment = loc.return_air()
var/environment_pressure = environment.return_pressure()
@@ -89,7 +89,7 @@ Acts like a normal vent, but has an input AND output.
loc.assume_air(removed)
air_update_turf()
- var/datum/pipeline/parent1 = parents[PARENT1]
+ var/datum/pipeline/parent1 = PARENT1
parent1.update = 1
else //external -> output
@@ -109,7 +109,7 @@ Acts like a normal vent, but has an input AND output.
air2.merge(removed)
air_update_turf()
- var/datum/pipeline/parent2 = parents[PARENT2]
+ var/datum/pipeline/parent2 = PARENT2
parent2.update = 1
return 1
diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
index 63697dfaad6..d927ffab88a 100644
--- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
@@ -40,8 +40,8 @@ Passive gate is similar to the regular pump except:
if(!on)
return 0
- var/datum/gas_mixture/air1 = airs[AIR1]
- var/datum/gas_mixture/air2 = airs[AIR2]
+ var/datum/gas_mixture/air1 = AIR1
+ var/datum/gas_mixture/air2 = AIR2
var/output_starting_pressure = air2.return_pressure()
var/input_starting_pressure = air1.return_pressure()
diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm
index c9a3147e482..91467898b27 100644
--- a/code/ATMOSPHERICS/components/binary_devices/pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm
@@ -29,8 +29,9 @@ 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
return ..()
-
/obj/machinery/atmospherics/components/binary/pump/on
on = 1
@@ -48,8 +49,8 @@ Thus, the two variables affect pump operation are set in New():
if(!on)
return 0
- var/datum/gas_mixture/air1 = airs[AIR1]
- var/datum/gas_mixture/air2 = airs[AIR2]
+ var/datum/gas_mixture/air1 = AIR1
+ var/datum/gas_mixture/air2 = AIR2
var/output_starting_pressure = air2.return_pressure()
diff --git a/code/ATMOSPHERICS/components/binary_devices/valve.dm b/code/ATMOSPHERICS/components/binary_devices/valve.dm
index 3239d3a6ec4..a99fa0df02b 100644
--- a/code/ATMOSPHERICS/components/binary_devices/valve.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/valve.dm
@@ -28,7 +28,7 @@ It's like a regular ol' straight pipe, but you can turn it on and off.
open = 1
update_icon_nopipes()
update_parents()
- var/datum/pipeline/parent1 = parents[PARENT1]
+ var/datum/pipeline/parent1 = PARENT1
parent1.reconcile_air()
investigate_log("was opened by [usr ? key_name(usr) : "a remote signal"]", "atmos")
diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm
index 39160074e52..010a10fb5de 100644
--- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm
@@ -48,8 +48,8 @@ Thus, the two variables affect pump operation are set in New():
if(!on)
return 0
- var/datum/gas_mixture/air1 = airs[AIR1]
- var/datum/gas_mixture/air2 = airs[AIR2]
+ var/datum/gas_mixture/air1 = AIR1
+ var/datum/gas_mixture/air2 = AIR2
// Pump mechanism just won't do anything if the pressure is too high/too low
@@ -125,7 +125,7 @@ Thus, the two variables affect pump operation are set in New():
on = !on
if("set_transfer_rate" in signal.data)
- var/datum/gas_mixture/air1 = airs[AIR1]
+ var/datum/gas_mixture/air1 = AIR1
transfer_rate = Clamp(
text2num(signal.data["set_transfer_rate"]),
0,
diff --git a/code/ATMOSPHERICS/components/components_base.dm b/code/ATMOSPHERICS/components/components_base.dm
index 46f5ac86d99..ace7ce4b31b 100644
--- a/code/ATMOSPHERICS/components/components_base.dm
+++ b/code/ATMOSPHERICS/components/components_base.dm
@@ -3,50 +3,31 @@ So much of atmospherics.dm was used solely by components, so separating this mak
On top of that, now people can add component-speciic procs/vars if they want!
*/
-#define UNARY 1
-#define BINARY 2
-#define TRINARY 3
-
-#define AIR1 "a1"
-#define AIR2 "a2"
-#define AIR3 "a3"
-
-#define PARENT1 "p1"
-#define PARENT2 "p2"
-#define PARENT3 "p3"
-
-#define NODE1 "n1"
-#define NODE2 "n2"
-#define NODE3 "n3"
-
/obj/machinery/atmospherics/components/
var/welded = 0 //Used on pumps and scrubbers
var/showpipe = 0
- var/device_type = 0//used for initialization stuff
- //UNARY = 1
- //BINARY = 2
- //TRINARY = 3
-
- var/list/obj/machinery/atmospherics/nodes = list()
var/list/datum/pipeline/parents = list()
var/list/datum/gas_mixture/airs = list()
/obj/machinery/atmospherics/components/New()
..()
- for(var/I = 1; I <= device_type; I++)
+ parents.len = device_type
+ airs.len = device_type
+
+ for(DEVICE_TYPE_LOOP)
var/datum/gas_mixture/A = new
A.volume = 200
- airs["a[I]"] = A
+ AIR_I = A
/*
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
@@ -73,9 +54,9 @@ Iconnery
var/connected = 0
- for(var/I = 1; I <= device_type; I++) //adds intact pieces
- if(nodes["n[I]"])
- connected = icon_addintact(nodes["n[I]"], connected)
+ for(DEVICE_TYPE_LOOP) //adds intact pieces
+ if(NODE_I)
+ connected |= icon_addintact(NODE_I)
icon_addbroken(connected) //adds broken pieces
@@ -83,82 +64,52 @@ Iconnery
/*
Pipenet stuff; housekeeping
*/
-/obj/machinery/atmospherics/components/Destroy()
- for(var/I = 1; I <= device_type; I++)
- var/obj/machinery/atmospherics/N = nodes["n[I]"]
- if(N)
- N.disconnect(src)
- nodes["n[I]"] = null
- nullifyPipenet(parents["p[I]"])
- return ..()
-/obj/machinery/atmospherics/components/atmosinit(var/list/node_connects)
- for(var/I = 1; I <= device_type; I++)
- for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[I]))
- if(target.initialize_directions & get_dir(target,src))
- nodes["n[I]"] = target
- break
- update_icon()
+/obj/machinery/atmospherics/components/nullifyNode(I)
+ ..()
+ nullifyPipenet(PARENT_I)
+ qdel(AIR_I)
+ AIR_I = null
/obj/machinery/atmospherics/components/construction()
..()
update_parents()
/obj/machinery/atmospherics/components/build_network()
- for(var/I = 1; I <= device_type; I++)
- if(!parents["p[I]"])
- parents["p[I]"] = new /datum/pipeline()
- var/datum/pipeline/P = parents["p[I]"]
+ for(DEVICE_TYPE_LOOP)
+ if(!PARENT_I)
+ PARENT_I = new /datum/pipeline()
+ var/datum/pipeline/P = PARENT_I
P.build_pipeline(src)
-/obj/machinery/atmospherics/components/disconnect(obj/machinery/atmospherics/reference)
- for(var/I = 1; I <= device_type; I++)
- if(reference == nodes["n[I]"])
- if(istype(nodes["n[I]"], /obj/machinery/atmospherics/pipe))
- qdel(parents["p[I]"])
- nodes["n[I]"] = null
- break
- update_icon()
-
-/obj/machinery/atmospherics/components/nullifyPipenet(datum/pipeline/reference)
- ..()
- for(var/I = 1; I <= device_type; I++)
- if(reference == parents["p[I]"])
- var/datum/pipeline/P = parents["p[I]"]
- P.other_airs -= airs["a[I]"]
- parents["p[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(var/I = 1; I <= device_type; I++)
- if(reference == parents["p[I]"])
- return airs["a[I]"]
+ var/I = parents.Find(reference)
+ return AIR_I
/obj/machinery/atmospherics/components/pipeline_expansion(datum/pipeline/reference)
if(reference)
- for(var/I = 1; I <= device_type; I++)
- if(parents["p[I]"] == reference)
- return list(nodes["n[I]"])
+ var/I = parents.Find(reference)
+ return list(NODE_I)
else
- var/list/obj/machinery/atmospherics/return_nodes = list()
- for(var/I = 1; I <= device_type; I++)
- return_nodes += nodes["n[I]"]
- return return_nodes
+ return ..()
/obj/machinery/atmospherics/components/setPipenet(datum/pipeline/reference, obj/machinery/atmospherics/A)
- for(var/I = 1; I <= device_type; I++)
- if(A == nodes["n[I]"])
- parents["p[I]"] = reference
- break
+ var/I = nodes.Find(A)
+ PARENT_I = reference
-/obj/machinery/atmospherics/components/returnPipenet(obj/machinery/atmospherics/A = nodes[NODE1]) //returns PARENT1 if called without argument
- for(var/I = 1; I <= device_type; I++)
- if(A == nodes["n[I]"])
- return parents["p[I]"]
+/obj/machinery/atmospherics/components/returnPipenet(obj/machinery/atmospherics/A = NODE1) //returns PARENT1 if called without argument
+ var/I = nodes.Find(A)
+ return PARENT_I
/obj/machinery/atmospherics/components/replacePipenet(datum/pipeline/Old, datum/pipeline/New)
- for(var/I = 1; I <= device_type; I++)
- if(parents["p[I]"] == Old)
- parents["p[I]"] = New
+ var/I = parents.Find(Old)
+ PARENT_I = New
/obj/machinery/atmospherics/components/unsafe_pressure_release(var/mob/user, var/pressures)
..()
@@ -169,15 +120,15 @@ Pipenet stuff; housekeeping
var/datum/gas_mixture/environment = T.return_air()
var/lost = null
var/times_lost = 0
- for(var/I = 1; I <= device_type; I++)
- var/datum/gas_mixture/air = airs["a[I]"]
+ for(DEVICE_TYPE_LOOP)
+ var/datum/gas_mixture/air = AIR_I
lost += pressures*environment.volume/(air.temperature * R_IDEAL_GAS_EQUATION)
times_lost++
var/shared_loss = lost/times_lost
var/datum/gas_mixture/to_release
- for(var/I = 1; I <= device_type; I++)
- var/datum/gas_mixture/air = airs["a[I]"]
+ for(DEVICE_TYPE_LOOP)
+ var/datum/gas_mixture/air = AIR_I
if(!to_release)
to_release = air.remove(shared_loss)
continue
@@ -200,6 +151,6 @@ Helpers
*/
/obj/machinery/atmospherics/components/proc/update_parents()
- for(var/I = 1; I <= device_type; I++)
- var/datum/pipeline/parent = parents["p[I]"]
+ for(DEVICE_TYPE_LOOP)
+ var/datum/pipeline/parent = PARENT_I
parent.update = 1
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm
index 49029140f7e..b2464c2a129 100644
--- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm
@@ -62,7 +62,7 @@ Filter types:
/obj/machinery/atmospherics/components/trinary/filter/update_icon_nopipes()
- if(!(stat & NOPOWER) && on && nodes[NODE1] && nodes[NODE2] && nodes[NODE3])
+ if(!(stat & NOPOWER) && on && NODE1 && NODE2 && NODE3)
icon_state = "filter_on[flipped?"_f":""]"
return
@@ -80,12 +80,12 @@ Filter types:
..()
if(!on)
return 0
- if(!(nodes[NODE1] && nodes[NODE2] && nodes[NODE3]))
+ if(!(NODE1 && NODE2 && NODE3))
return 0
- var/datum/gas_mixture/air1 = airs[AIR1]
- var/datum/gas_mixture/air2 = airs[AIR2]
- var/datum/gas_mixture/air3 = airs[AIR3]
+ var/datum/gas_mixture/air1 = AIR1
+ var/datum/gas_mixture/air2 = AIR2
+ var/datum/gas_mixture/air3 = AIR3
var/output_starting_pressure = air3.return_pressure()
diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
index 8b8850744ec..14c3c47adf7 100644
--- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
@@ -29,10 +29,10 @@
overlays += getpipeimage('icons/obj/atmospherics/components/trinary_devices.dmi', "cap", direction, node.pipe_color)
continue
overlays += getpipeimage('icons/obj/atmospherics/components/trinary_devices.dmi', "cap", direction)
- ..()
+ return ..()
/obj/machinery/atmospherics/components/trinary/mixer/update_icon_nopipes()
- if(!(stat & NOPOWER) && on && nodes[NODE1] && nodes[NODE2] && nodes[NODE3])
+ if(!(stat & NOPOWER) && on && NODE1 && NODE2 && NODE3)
icon_state = "mixer_on[flipped?"_f":""]"
return
@@ -48,20 +48,20 @@
/obj/machinery/atmospherics/components/trinary/mixer/New()
..()
- var/datum/gas_mixture/air3 = airs[AIR3]
+ var/datum/gas_mixture/air3 = AIR3
air3.volume = 300
- airs[AIR3] = air3
+ AIR3 = air3
/obj/machinery/atmospherics/components/trinary/mixer/process_atmos()
..()
if(!on)
return 0
- if(!(nodes[NODE1] && nodes[NODE2] && nodes[NODE3]))
+ if(!(NODE1 && NODE2 && NODE3))
return 0
- var/datum/gas_mixture/air1 = airs[AIR1]
- var/datum/gas_mixture/air2 = airs[AIR2]
- var/datum/gas_mixture/air3 = airs[AIR3]
+ var/datum/gas_mixture/air1 = AIR1
+ var/datum/gas_mixture/air2 = AIR2
+ var/datum/gas_mixture/air3 = AIR3
var/output_starting_pressure = air3.return_pressure()
@@ -107,14 +107,14 @@
air3.merge(removed2)
if(transfer_moles1)
- var/datum/pipeline/parent1 = parents[PARENT1]
+ var/datum/pipeline/parent1 = PARENT1
parent1.update = 1
if(transfer_moles2)
- var/datum/pipeline/parent2 = parents[PARENT2]
+ var/datum/pipeline/parent2 = PARENT2
parent2.update = 1
- var/datum/pipeline/parent3 = parents[PARENT3]
+ var/datum/pipeline/parent3 = PARENT3
parent3.update = 1
return 1
diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
index cec9c7ed27b..d2c37ec30e0 100644
--- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
@@ -43,7 +43,5 @@ Housekeeping and pipe network stuff
node1_connect = turn(node1_connect, 180)
node3_connect = turn(node3_connect, 180)
- var/list/node_connects = new/list()
-
- node_connects.Add(node1_connect, node2_connect, node3_connect)
+ var/list/node_connects = list(node1_connect, node2_connect, node3_connect)
..(node_connects)
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/unary_devices/Freezer.dm b/code/ATMOSPHERICS/components/unary_devices/Freezer.dm
index b91d8a74dbb..83739c0e13b 100644
--- a/code/ATMOSPHERICS/components/unary_devices/Freezer.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/Freezer.dm
@@ -69,7 +69,7 @@
/obj/machinery/atmospherics/components/unary/cold_sink/freezer/interact(mob/user)
if(stat & (NOPOWER|BROKEN))
return
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
user.set_machine(src)
var/temp_text = ""
if(air_contents.temperature > (T0C - 20))
@@ -194,7 +194,7 @@
return interact(user)
/obj/machinery/atmospherics/components/unary/heat_reservoir/heater/interact(mob/user)
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
if(stat & (NOPOWER|BROKEN))
return
diff --git a/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm b/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm
index 7750a7c7b14..65419798bfd 100644
--- a/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm
@@ -16,7 +16,7 @@
if(showpipe)
overlays += getpipeimage('icons/obj/atmospherics/components/unary_devices.dmi', "scrub_cap", initialize_directions) //scrub_cap works for now
- if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
+ if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
icon_state = "cold_off"
return
@@ -27,7 +27,7 @@
..()
if(!on)
return 0
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
var/air_heat_capacity = air_contents.heat_capacity()
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
diff --git a/code/ATMOSPHERICS/components/unary_devices/cryo.dm b/code/ATMOSPHERICS/components/unary_devices/cryo.dm
index 03c978cead4..cc407460306 100644
--- a/code/ATMOSPHERICS/components/unary_devices/cryo.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/cryo.dm
@@ -47,7 +47,7 @@
return ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/process_atmos()
..()
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
if(air_contents)
temperature_archived = air_contents.temperature
@@ -62,14 +62,14 @@
on = 0
open_machine()
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
- if(!nodes[NODE1] || !is_operational())
+ if(!NODE1 || !is_operational())
return
if(!on)
updateDialog()
return
- if(airs[AIR1])
+ if(AIR1)
if (occupant)
process_occupant()
expel_gas()
@@ -145,7 +145,7 @@
/obj/machinery/atmospherics/components/unary/cryo_cell/get_ui_data()
// this is the data which will be sent to the ui
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
var/data = list()
data["isOperating"] = on
@@ -289,7 +289,7 @@
update_icon()
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/process_occupant()
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
if(air_contents.total_moles() < 10)
return
if(occupant)
@@ -321,7 +321,7 @@
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/heat_gas_contents()
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
if(air_contents.total_moles() < 1)
return
@@ -332,7 +332,7 @@
air_contents.temperature = combined_energy/combined_heat_capacity
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/expel_gas()
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
if(air_contents.total_moles() < 1)
return
diff --git a/code/ATMOSPHERICS/components/unary_devices/generator_input.dm b/code/ATMOSPHERICS/components/unary_devices/generator_input.dm
index 20d1474ffd3..15ae3eb88f9 100644
--- a/code/ATMOSPHERICS/components/unary_devices/generator_input.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/generator_input.dm
@@ -9,7 +9,7 @@
var/update_cycle
/obj/machinery/atmospherics/components/unary/generator_input/update_icon()
- if(nodes[NODE1])
+ if(NODE1)
icon_state = "intact"
else
icon_state = "exposed"
@@ -17,4 +17,4 @@
return
/obj/machinery/atmospherics/components/unary/generator_input/proc/return_exchange_air()
- return airs[AIR1]
+ return AIR1
diff --git a/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm
index 21746bc4e97..1b400dad2bb 100644
--- a/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm
@@ -11,9 +11,9 @@
var/update_cycle
/obj/machinery/atmospherics/components/unary/heat_exchanger/update_icon()
- if(nodes[NODE1])
+ if(NODE1)
icon_state = "he_intact"
- var/obj/machinery/atmospherics/node = nodes[NODE1]
+ var/obj/machinery/atmospherics/node = NODE1
color = node.color
else
icon_state = "he_exposed"
@@ -43,8 +43,8 @@
update_cycle = SSair.times_fired
partner.update_cycle = SSair.times_fired
- var/datum/gas_mixture/air_contents = airs[AIR1]
- var/datum/gas_mixture/partner_air_contents = partner.airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
+ var/datum/gas_mixture/partner_air_contents = partner.AIR1
var/air_heat_capacity = air_contents.heat_capacity()
var/other_air_heat_capacity = partner_air_contents.heat_capacity()
diff --git a/code/ATMOSPHERICS/components/unary_devices/heat_source.dm b/code/ATMOSPHERICS/components/unary_devices/heat_source.dm
index ceba342a5fa..b08a4a214a7 100644
--- a/code/ATMOSPHERICS/components/unary_devices/heat_source.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/heat_source.dm
@@ -17,7 +17,7 @@
if(showpipe)
overlays += getpipeimage('icons/obj/atmospherics/components/unary_devices.dmi', "scrub_cap", initialize_directions) //scrub_cap works for now
- if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
+ if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
icon_state = "cold_off"
return
@@ -29,7 +29,7 @@
if(!on)
return 0
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
var/air_heat_capacity = air_contents.heat_capacity()
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
diff --git a/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm b/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm
index 430d8b42820..df9af8f6cfc 100644
--- a/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm
@@ -25,7 +25,7 @@
on = 1
/obj/machinery/atmospherics/components/unary/outlet_injector/update_icon_nopipes()
- if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
+ if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
icon_state = "inje_off"
return
@@ -45,7 +45,7 @@
if(!on || stat & NOPOWER)
return 0
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
if(air_contents.temperature > 0)
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
@@ -63,7 +63,7 @@
if(on || injecting)
return 0
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
injecting = 1
@@ -126,7 +126,7 @@
if("set_volume_rate" in signal.data)
var/number = text2num(signal.data["set_volume_rate"])
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
volume_rate = Clamp(number, 0, air_contents.volume)
if("status" in signal.data)
diff --git a/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm b/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm
index d8c1d69e200..0c0bee0b275 100644
--- a/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm
@@ -18,7 +18,7 @@
if(showpipe)
overlays += getpipeimage('icons/obj/atmospherics/components/unary_devices.dmi', "scrub_cap", initialize_directions) //it works for now
- if(!nodes[NODE1] || !on || stat & BROKEN)
+ if(!NODE1 || !on || stat & BROKEN)
icon_state = "o2gen_off"
return
@@ -27,16 +27,16 @@
/obj/machinery/atmospherics/components/unary/oxygen_generator/New()
..()
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
air_contents.volume = 50
- airs[AIR1] = air_contents
+ AIR1 = air_contents
/obj/machinery/atmospherics/components/unary/oxygen_generator/process_atmos()
..()
if(!on)
return 0
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
var/total_moles = air_contents.total_moles()
diff --git a/code/ATMOSPHERICS/components/unary_devices/tank.dm b/code/ATMOSPHERICS/components/unary_devices/tank.dm
index 8f8f6b9e831..cfbaf0ad995 100644
--- a/code/ATMOSPHERICS/components/unary_devices/tank.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/tank.dm
@@ -1,3 +1,4 @@
+#define AIR_CONTENTS (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
/obj/machinery/atmospherics/components/unary/tank
icon = 'icons/obj/atmospherics/pipes/pressure_tank.dmi'
icon_state = "generic"
@@ -6,15 +7,19 @@
var/volume = 10000 //in liters, 1 meters by 1 meters by 2 meters
density = 1
+/obj/machinery/atmospherics/components/unary/tank/New()
+ ..()
+ var/datum/gas_mixture/air_contents = AIR1
+ air_contents.volume = volume
+ air_contents.temperature = T20C
+
/obj/machinery/atmospherics/components/unary/tank/carbon_dioxide
name = "pressure tank (Carbon Dioxide)"
/obj/machinery/atmospherics/components/unary/tank/carbon_dioxide/New()
..()
- var/datum/gas_mixture/air_contents = airs[AIR1]
- air_contents.volume = volume
- air_contents.temperature = T20C
- air_contents.carbon_dioxide = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
+ var/datum/gas_mixture/air_contents = AIR1
+ air_contents.carbon_dioxide = AIR_CONTENTS
/obj/machinery/atmospherics/components/unary/tank/toxins
icon_state = "orange"
@@ -22,10 +27,8 @@
/obj/machinery/atmospherics/components/unary/tank/toxins/New()
..()
- var/datum/gas_mixture/air_contents = airs[AIR1]
- air_contents.volume = volume
- air_contents.temperature = T20C
- air_contents.toxins = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
+ var/datum/gas_mixture/air_contents = AIR1
+ air_contents.toxins = AIR_CONTENTS
/obj/machinery/atmospherics/components/unary/tank/oxygen_agent_b
icon_state = "orange_2"
@@ -33,11 +36,9 @@
/obj/machinery/atmospherics/components/unary/tank/oxygen_agent_b/New()
..()
- var/datum/gas_mixture/air_contents = airs[AIR1]
- air_contents.volume = volume
- air_contents.temperature = T0C
+ var/datum/gas_mixture/air_contents = AIR1
var/datum/gas/oxygen_agent_b/trace_gas = new
- trace_gas.moles = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
+ trace_gas.moles = AIR_CONTENTS
air_contents.trace_gases += trace_gas
/obj/machinery/atmospherics/components/unary/tank/oxygen
@@ -46,10 +47,8 @@
/obj/machinery/atmospherics/components/unary/tank/oxygen/New()
..()
- var/datum/gas_mixture/air_contents = airs[AIR1]
- air_contents.volume = volume
- air_contents.temperature = T20C
- air_contents.oxygen = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
+ var/datum/gas_mixture/air_contents = AIR1
+ air_contents.oxygen = AIR_CONTENTS
/obj/machinery/atmospherics/components/unary/tank/nitrogen
icon_state = "red"
@@ -57,10 +56,8 @@
/obj/machinery/atmospherics/components/unary/tank/nitrogen/New()
..()
- var/datum/gas_mixture/air_contents = airs[AIR1]
- air_contents.volume = volume
- air_contents.temperature = T20C
- air_contents.nitrogen = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
+ var/datum/gas_mixture/air_contents = AIR1
+ air_contents.nitrogen = AIR_CONTENTS
/obj/machinery/atmospherics/components/unary/tank/air
icon_state = "grey"
@@ -68,8 +65,6 @@
/obj/machinery/atmospherics/components/unary/tank/air/New()
..()
- var/datum/gas_mixture/air_contents = airs[AIR1]
- air_contents.volume = volume
- air_contents.temperature = T20C
- air_contents.oxygen = (25*ONE_ATMOSPHERE*O2STANDARD)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
- air_contents.nitrogen = (25*ONE_ATMOSPHERE*N2STANDARD)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
\ No newline at end of file
+ var/datum/gas_mixture/air_contents = AIR1
+ air_contents.oxygen = AIR_CONTENTS
+ air_contents.nitrogen = AIR_CONTENTS
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm
index 44519b8245f..2e018e313b7 100644
--- a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm
@@ -17,26 +17,17 @@ Iconnery
..(intact)
-/*
-Housekeeping and pipe network stuff below
-*/
-
-/obj/machinery/atmospherics/components/unary/atmosinit()
- var/list/node_connects = new/list()
- node_connects.Add(dir)
- ..(node_connects)
-
/obj/machinery/atmospherics/components/unary/default_change_direction_wrench(mob/user, obj/item/weapon/wrench/W)
if(!..())
return
SetInitDirections()
- var/obj/machinery/atmospherics/node = nodes[NODE1]
+ var/obj/machinery/atmospherics/node = NODE1
if(node)
node.disconnect(src)
node = null
- nullifyPipenet(parents[PARENT1])
+ nullifyPipenet(PARENT1)
atmosinit()
- node = nodes[NODE1]
+ node = NODE1
if(node)
node.atmosinit()
node.addMember(src)
diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm
index c6bc8523f43..487c3323f04 100644
--- a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm
@@ -2,6 +2,9 @@
#define INT_BOUND 2
#define NO_BOUND 3
+#define SIPHONING 0
+#define RELEASING 1
+
/obj/machinery/atmospherics/components/unary/vent_pump
icon_state = "vent_map"
@@ -19,12 +22,12 @@
var/id_tag = null
var/on = 0
- var/pump_direction = 1 //0 = siphoning, 1 = releasing
+ var/pump_direction = RELEASING
var/external_pressure_bound = ONE_ATMOSPHERE
var/internal_pressure_bound = 0
- var/pressure_checks = 1
+ var/pressure_checks = EXT_BOUND
//EXT_BOUND: Do not pass external_pressure_bound
//INT_BOUND: Do not pass internal_pressure_bound
//NO_BOUND: Do not pass either
@@ -40,7 +43,7 @@
icon_state = "vent_out"
/obj/machinery/atmospherics/components/unary/vent_pump/siphon
- pump_direction = 0
+ pump_direction = SIPHONING
/obj/machinery/atmospherics/components/unary/vent_pump/siphon/on
on = 1
@@ -59,6 +62,11 @@
/obj/machinery/atmospherics/components/unary/vent_pump/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
+ radio_connection = null
+ if(initial_loc)
+ initial_loc.air_vent_info -= id_tag
+ initial_loc.air_vent_names -= id_tag
+ initial_loc = null
return ..()
/obj/machinery/atmospherics/components/unary/vent_pump/high_volume
@@ -67,7 +75,7 @@
/obj/machinery/atmospherics/components/unary/vent_pump/high_volume/New()
..()
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
air_contents.volume = 1000
/obj/machinery/atmospherics/components/unary/vent_pump/update_icon_nopipes()
@@ -79,20 +87,20 @@
icon_state = "vent_welded"
return
- if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
+ if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
icon_state = "vent_off"
return
- if(pump_direction)
+ if(pump_direction & RELEASING)
icon_state = "vent_out"
- else
+ if(pump_direction & SIPHONING)
icon_state = "vent_in"
/obj/machinery/atmospherics/components/unary/vent_pump/process_atmos()
..()
if(stat & (NOPOWER|BROKEN))
return
- if (!nodes[NODE1])
+ if (!NODE1)
on = 0
//broadcast_status() // from now air alarm/control computer should request update purposely --rastaf0
if(!on)
@@ -101,11 +109,11 @@
if(welded)
return 0
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
var/datum/gas_mixture/environment = loc.return_air()
var/environment_pressure = environment.return_pressure()
- if(pump_direction) //internal -> external
+ if(pump_direction & RELEASING) //internal -> external
var/pressure_delta = 10000
if(pressure_checks&EXT_BOUND)
@@ -122,7 +130,7 @@
loc.assume_air(removed)
air_update_turf()
- else //external -> internal
+ if(pump_direction & SIPHONING) //external -> internal
var/pressure_delta = 10000
if(pressure_checks&EXT_BOUND)
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
@@ -201,11 +209,11 @@
if("purge" in signal.data)
pressure_checks &= ~EXT_BOUND
- pump_direction = 0
+ pump_direction = SIPHONING
if("stabalize" in signal.data)
pressure_checks |= EXT_BOUND
- pump_direction = 1
+ pump_direction = RELEASING
if("power" in signal.data)
on = text2num(signal.data["power"])
@@ -305,8 +313,15 @@
if(initial_loc)
initial_loc.air_vent_info -= id_tag
initial_loc.air_vent_names -= id_tag
- return ..()
+ ..()
/obj/machinery/atmospherics/components/unary/vent_pump/can_crawl_through()
return !welded
+
+#undef INT_BOUND
+#undef EXT_BOUND
+#undef NO_BOUND
+
+#undef SIPHONING
+#undef RELEASING
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm
index 95fb33af540..cee4e68b4d5 100644
--- a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm
+++ b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm
@@ -1,3 +1,6 @@
+#define SIPHONING 0
+#define SCRUBBING 1
+
/obj/machinery/atmospherics/components/unary/vent_scrubber
icon_state = "scrub_map"
@@ -22,7 +25,7 @@
var/list/turf/simulated/adjacent_turfs = list()
var/on = 0
- var/scrubbing = 1 //0 = siphoning, 1 = scrubbing
+ var/scrubbing = SCRUBBING //0 = siphoning, 1 = scrubbing
var/scrub_CO2 = 1
var/scrub_Toxins = 0
var/scrub_N2O = 0
@@ -48,9 +51,13 @@
/obj/machinery/atmospherics/components/unary/vent_scrubber/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
+ 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
return ..()
/obj/machinery/atmospherics/components/unary/vent_scrubber/auto_use_power()
if(!powered(power_channel))
@@ -62,14 +69,14 @@
var/amount = idle_power_usage
- if (scrubbing)
+ if(scrubbing & SCRUBBING)
if (scrub_CO2)
amount += idle_power_usage
if (scrub_Toxins)
amount += idle_power_usage
if (scrub_N2O)
amount += idle_power_usage
- else
+ if(scrubbing & SIPHONING)
amount = active_power_usage
if (widenet)
@@ -86,13 +93,13 @@
icon_state = "scrub_welded"
return
- if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
+ if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
icon_state = "scrub_off"
return
- if(scrubbing)
+ if(scrubbing & SCRUBBING)
icon_state = "scrub_on"
- else
+ if(scrubbing & SIPHONING)
icon_state = "scrub_purge"
/obj/machinery/atmospherics/components/unary/vent_scrubber/proc/set_frequency(new_frequency)
@@ -142,7 +149,7 @@
..()
if(stat & (NOPOWER|BROKEN))
return
- if (!nodes[NODE1])
+ if (!NODE1)
on = 0
//broadcast_status()
if(!on || welded)
@@ -159,9 +166,9 @@
return 0
var/datum/gas_mixture/environment = tile.return_air()
- var/datum/gas_mixture/air_contents = airs[AIR1]
+ var/datum/gas_mixture/air_contents = AIR1
- if(scrubbing)
+ if(scrubbing & SCRUBBING)
if((environment.toxins>0) || (environment.carbon_dioxide>0) || (environment.trace_gases.len>0))
var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles()
@@ -196,7 +203,7 @@
tile.assume_air(removed)
tile.air_update_turf()
- else //Just siphoning all air
+ if(scrubbing & SIPHONING) //Just siphoning all air
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
return
@@ -312,3 +319,6 @@
/obj/machinery/atmospherics/components/unary/vent_scrubber/can_crawl_through()
return !welded
+
+#undef SIPHONING
+#undef SCRUBBING
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/pipes/he_pipes.dm b/code/ATMOSPHERICS/pipes/he_pipes.dm
deleted file mode 100644
index 2aec1195433..00000000000
--- a/code/ATMOSPHERICS/pipes/he_pipes.dm
+++ /dev/null
@@ -1,154 +0,0 @@
-////////////
-//HE Pipes
-////////////
-
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging
- icon = 'icons/obj/atmospherics/pipes/heat.dmi'
- icon_state = "intact"
- level = 2
- var/initialize_directions_he
- var/minimum_temperature_difference = 20
- var/thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT
- color = "#404040"
- buckle_lying = 1
- var/icon_temperature = T20C //stop small changes in temperature causing icon refresh
-
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging/New()
- ..()
- color = "#404040"
-
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging/SetInitDirections()
- switch(dir)
- if(SOUTH)
- initialize_directions_he = SOUTH|NORTH
- if(NORTH)
- initialize_directions_he = SOUTH|NORTH
- if(EAST)
- initialize_directions_he = EAST|WEST
- if(WEST)
- initialize_directions_he = WEST|EAST
- if(NORTHEAST)
- initialize_directions_he = NORTH|EAST
- if(NORTHWEST)
- initialize_directions_he = NORTH|WEST
- if(SOUTHEAST)
- initialize_directions_he = SOUTH|EAST
- if(SOUTHWEST)
- initialize_directions_he = SOUTH|WEST
-
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging/GetInitDirections()
- return ..() | initialize_directions_he
-
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging/atmosinit()
- normalize_dir()
- var/N = 2
- for(var/D in cardinal)
- if(D & initialize_directions_he)
- N--
- for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src, D))
- if(target.initialize_directions_he & get_dir(target,src))
- if(!node1 && N == 1)
- node1 = target
- break
- if(!node2 && N == 0)
- node2 = target
- break
- update_icon()
- ..()
-
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging/process_atmos()
- var/environment_temperature = 0
- var/datum/gas_mixture/pipe_air = return_air()
-
- if(istype(loc, /turf/simulated))
- if(loc:blocks_air)
- environment_temperature = loc:temperature
- else
- var/datum/gas_mixture/environment = loc.return_air()
- environment_temperature = environment.temperature
- else
- environment_temperature = loc:temperature
-
- if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
- parent.temperature_interact(loc, volume, thermal_conductivity)
-
-
- //heatup/cooldown any mobs buckled to ourselves based on our temperature
- if(buckled_mob)
- var/hc = pipe_air.heat_capacity()
- var/avg_temp = (pipe_air.temperature * hc + buckled_mob.bodytemperature * 3500) / (hc + 3500)
- pipe_air.temperature = avg_temp
- buckled_mob.bodytemperature = avg_temp
-
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging/process()
- var/datum/gas_mixture/pipe_air = return_air()
- //Burn any mobs buckled to ourselves based on our temperature
- if(buckled_mob)
- var/heat_limit = 1000
- if(pipe_air.temperature > heat_limit + 1)
- buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, "chest")
-
- //Heat causes pipe to glow
- if(pipe_air.temperature && (icon_temperature > 500 || pipe_air.temperature > 500)) //glow starts at 500K
- if(abs(pipe_air.temperature - icon_temperature) > 10)
- icon_temperature = pipe_air.temperature
-
- var/h_r = heat2colour_r(icon_temperature)
- var/h_g = heat2colour_g(icon_temperature)
- var/h_b = heat2colour_b(icon_temperature)
-
- if(icon_temperature < 2000)//scale glow until 2000K
- var/scale = (icon_temperature - 500) / 1500
- h_r = 64 + (h_r - 64) * scale
- h_g = 64 + (h_g - 64) * scale
- h_b = 64 + (h_b - 64) * scale
-
- animate(src, color = rgb(h_r, h_g, h_b), time = 20, easing = SINE_EASING)
-
-////////////////
-//HE Junctions
-////////////////
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction
- icon = 'icons/obj/atmospherics/pipes/junction.dmi'
- icon_state = "intact"
- level = 2
- minimum_temperature_difference = 300
- thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT
-
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/normalize_dir()
- return
-
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/SetInitDirections()
- switch(dir)
- if(SOUTH)
- initialize_directions = NORTH
- initialize_directions_he = SOUTH
- if(NORTH)
- initialize_directions = SOUTH
- initialize_directions_he = NORTH
- if(EAST)
- initialize_directions = WEST
- initialize_directions_he = EAST
- if(WEST)
- initialize_directions = EAST
- initialize_directions_he = WEST
-
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/update_icon()
- if(node1&&node2)
- icon_state = "intact"
- else
- var/have_node1 = node1?1:0
- var/have_node2 = node2?1:0
- icon_state = "exposed[have_node1][have_node2]"
-
-/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/atmosinit()
- for(var/obj/machinery/atmospherics/target in get_step(src,initialize_directions))
- if(target.initialize_directions & get_dir(target,src))
- node1 = target
- break
- for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,initialize_directions_he))
- if(target.initialize_directions_he & get_dir(target,src))
- node2 = target
- break
- update_icon()
- ..()
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/pipes/heat_exchange/he_pipes.dm b/code/ATMOSPHERICS/pipes/heat_exchange/he_pipes.dm
new file mode 100644
index 00000000000..30c7bf9e630
--- /dev/null
+++ b/code/ATMOSPHERICS/pipes/heat_exchange/he_pipes.dm
@@ -0,0 +1,75 @@
+/obj/machinery/atmospherics/pipe/heat_exchanging/
+ icon = 'icons/obj/atmospherics/pipes/heat.dmi'
+ level = 2
+ var/initialize_directions_he
+ var/minimum_temperature_difference = 20
+ var/thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT
+ color = "#404040"
+ buckle_lying = 1
+ var/icon_temperature = T20C //stop small changes in temperature causing icon refresh
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/New()
+ ..()
+ color = "#404040"
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/can_be_node(obj/machinery/atmospherics/pipe/heat_exchanging/target)
+ if(!istype(target))
+ return 0
+ if(target.initialize_directions_he & get_dir(target,src))
+ return 1
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/hide()
+ return
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/GetInitDirections()
+ return ..() | initialize_directions_he
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/process_atmos()
+ var/environment_temperature = 0
+ var/datum/gas_mixture/pipe_air = return_air()
+
+ var/turf/simulated/T = loc
+ if(istype(T))
+ if(T.blocks_air)
+ environment_temperature = T.temperature
+ else
+ var/datum/gas_mixture/environment = T.return_air()
+ environment_temperature = environment.temperature
+ else
+ environment_temperature = T.temperature
+
+ if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
+ parent.temperature_interact(T, volume, thermal_conductivity)
+
+
+ //heatup/cooldown any mobs buckled to ourselves based on our temperature
+ if(buckled_mob)
+ var/hc = pipe_air.heat_capacity()
+ var/avg_temp = (pipe_air.temperature * hc + buckled_mob.bodytemperature * 3500) / (hc + 3500)
+ pipe_air.temperature = avg_temp
+ buckled_mob.bodytemperature = avg_temp
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/process()
+ var/datum/gas_mixture/pipe_air = return_air()
+ //Burn any mobs buckled to ourselves based on our temperature
+ if(buckled_mob)
+ var/heat_limit = 1000
+ if(pipe_air.temperature > heat_limit + 1)
+ buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, "chest")
+
+ //Heat causes pipe to glow
+ if(pipe_air.temperature && (icon_temperature > 500 || pipe_air.temperature > 500)) //glow starts at 500K
+ if(abs(pipe_air.temperature - icon_temperature) > 10)
+ icon_temperature = pipe_air.temperature
+
+ var/h_r = heat2colour_r(icon_temperature)
+ var/h_g = heat2colour_g(icon_temperature)
+ var/h_b = heat2colour_b(icon_temperature)
+
+ if(icon_temperature < 2000)//scale glow until 2000K
+ var/scale = (icon_temperature - 500) / 1500
+ h_r = 64 + (h_r - 64) * scale
+ h_g = 64 + (h_g - 64) * scale
+ h_b = 64 + (h_b - 64) * scale
+
+ animate(src, color = rgb(h_r, h_g, h_b), time = 20, easing = SINE_EASING)
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/pipes/heat_exchange/junction.dm b/code/ATMOSPHERICS/pipes/heat_exchange/junction.dm
new file mode 100644
index 00000000000..b4424371ac0
--- /dev/null
+++ b/code/ATMOSPHERICS/pipes/heat_exchange/junction.dm
@@ -0,0 +1,51 @@
+/obj/machinery/atmospherics/pipe/heat_exchanging/junction
+ icon = 'icons/obj/atmospherics/pipes/junction.dmi'
+ icon_state = "intact"
+
+ name = "junction"
+ desc = "A one meter junction that connects regular and heat-exchanging pipe"
+
+ minimum_temperature_difference = 300
+ thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT
+ volume = 70
+
+ dir = SOUTH
+ initialize_directions = NORTH
+ initialize_directions_he = SOUTH
+
+ device_type = BINARY
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/junction/SetInitDirections()
+ switch(dir)
+ if(SOUTH)
+ initialize_directions = NORTH
+ initialize_directions_he = SOUTH
+ if(NORTH)
+ initialize_directions = SOUTH
+ initialize_directions_he = NORTH
+ if(EAST)
+ initialize_directions = WEST
+ initialize_directions_he = EAST
+ if(WEST)
+ initialize_directions = EAST
+ initialize_directions_he = WEST
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/junction/atmosinit()
+ var/node2_connect = dir
+ var/node1_connect = turn(dir, 180)
+ var/list/node_connects = list(node1_connect, node2_connect)
+
+ ..(node_connects)
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/junction/can_be_node(obj/machinery/atmospherics/target, iteration)
+ var/init_dir
+ switch(iteration)
+ if(1)
+ init_dir = target.initialize_directions
+ if(2)
+ var/obj/machinery/atmospherics/pipe/heat_exchanging/H = target
+ if(!istype(H))
+ return 0
+ init_dir = H.initialize_directions_he
+ if(init_dir & get_dir(target,src))
+ return 1
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/pipes/heat_exchange/simple.dm b/code/ATMOSPHERICS/pipes/heat_exchange/simple.dm
new file mode 100644
index 00000000000..71d9b06b647
--- /dev/null
+++ b/code/ATMOSPHERICS/pipes/heat_exchange/simple.dm
@@ -0,0 +1,35 @@
+/obj/machinery/atmospherics/pipe/heat_exchanging/simple
+ icon_state = "intact"
+
+ name = "pipe"
+ desc = "A one meter section of heat-exchanging pipe"
+
+ volume = 70
+
+ dir = SOUTH
+ initialize_directions_he = SOUTH|NORTH
+
+ device_type = BINARY
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/simple/SetInitDirections()
+ if(dir in diagonals)
+ initialize_directions_he = dir
+ switch(dir)
+ if(NORTH,SOUTH)
+ initialize_directions_he = SOUTH|NORTH
+ if(EAST,WEST)
+ initialize_directions_he = WEST|EAST
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/simple/proc/normalize_dir()
+ if(dir==SOUTH)
+ dir = NORTH
+ else if(dir==WEST)
+ dir = EAST
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/simple/atmosinit()
+ normalize_dir()
+ ..()
+
+/obj/machinery/atmospherics/pipe/heat_exchanging/simple/update_icon()
+ normalize_dir()
+ ..()
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm
index c8ae1b45986..afee736108c 100644
--- a/code/ATMOSPHERICS/pipes/manifold.dm
+++ b/code/ATMOSPHERICS/pipes/manifold.dm
@@ -1,8 +1,6 @@
-
/*
3-Way Manifold
*/
-
/obj/machinery/atmospherics/pipe/manifold
icon = 'icons/obj/atmospherics/pipes/manifold.dmi'
icon_state = "manifold"
@@ -15,17 +13,7 @@
dir = SOUTH
initialize_directions = EAST|NORTH|WEST
- var/obj/machinery/atmospherics/node1
- var/obj/machinery/atmospherics/node2
- var/obj/machinery/atmospherics/node3
-
- level = 1
- layer = 2.4 //under wires with their 2.44
-
-/obj/machinery/atmospherics/pipe/manifold/New()
- color = pipe_color
-
- ..()
+ device_type = TRINARY
/obj/machinery/atmospherics/pipe/manifold/SetInitDirections()
switch(dir)
@@ -38,59 +26,6 @@
if(WEST)
initialize_directions = NORTH|EAST|SOUTH
-/obj/machinery/atmospherics/pipe/manifold/atmosinit()
- for(var/D in cardinal)
- if(D == dir)
- continue
- for(var/obj/machinery/atmospherics/target in get_step(src, D))
- if(target.initialize_directions & get_dir(target,src))
- if(turn(dir, 90) == D)
- node1 = target
- if(turn(dir, 270) == D)
- node2 = target
- if(turn(dir, 180) == D)
- node3 = target
- break
- var/turf/T = src.loc // hide if turf is not intact
- hide(T.intact)
- update_icon()
- ..()
-
-/obj/machinery/atmospherics/pipe/manifold/Destroy()
- if(node1)
- var/obj/machinery/atmospherics/A = node1
- node1.disconnect(src)
- node1 = null
- A.build_network()
- if(node2)
- var/obj/machinery/atmospherics/A = node2
- node2.disconnect(src)
- node2 = null
- A.build_network()
- if(node3)
- var/obj/machinery/atmospherics/A = node3
- node3.disconnect(src)
- node3 = null
- A.build_network()
- releaseAirToTurf()
- return ..()
-
-/obj/machinery/atmospherics/pipe/manifold/disconnect(obj/machinery/atmospherics/reference)
- if(reference == node1)
- if(istype(node1, /obj/machinery/atmospherics/pipe))
- qdel(parent)
- node1 = null
- if(reference == node2)
- if(istype(node2, /obj/machinery/atmospherics/pipe))
- qdel(parent)
- node2 = null
- if(reference == node3)
- if(istype(node3, /obj/machinery/atmospherics/pipe))
- qdel(parent)
- node3 = null
- update_icon()
- ..()
-
/obj/machinery/atmospherics/pipe/manifold/update_icon()
var/invis = invisibility ? "-f" : ""
@@ -99,32 +34,9 @@
overlays.Cut()
//Add non-broken pieces
- if(node1)
- overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src,node1))
-
- if(node2)
- overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src,node2))
-
- if(node3)
- overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src,node3))
-
-/obj/machinery/atmospherics/pipe/manifold/hide(i)
- if(level == 1 && istype(loc, /turf/simulated))
- invisibility = i ? 101 : 0
- update_icon()
-
-/obj/machinery/atmospherics/pipe/manifold/pipeline_expansion()
- return list(node1, node2, node3)
-
-/obj/machinery/atmospherics/pipe/manifold/update_node_icon()
- ..()
- if(node1)
- node1.update_icon()
- if(node2)
- node2.update_icon()
- if(node3)
- node3.update_icon()
-
+ for(DEVICE_TYPE_LOOP)
+ if(NODE_I)
+ overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src, NODE_I))
//Colored pipes, use these for mapping
/obj/machinery/atmospherics/pipe/manifold/general
diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm
index d630135caad..aeacfcd0b48 100644
--- a/code/ATMOSPHERICS/pipes/manifold4w.dm
+++ b/code/ATMOSPHERICS/pipes/manifold4w.dm
@@ -1,4 +1,3 @@
-
/*
4-way manifold
*/
@@ -13,97 +12,12 @@
initialize_directions = NORTH|SOUTH|EAST|WEST
- var/obj/machinery/atmospherics/node1 // North
- var/obj/machinery/atmospherics/node2 // South
- var/obj/machinery/atmospherics/node3 // East
- var/obj/machinery/atmospherics/node4 // West
-
- level = 1
- layer = 2.4 //under wires with their 2.44
-
-/obj/machinery/atmospherics/pipe/manifold4w/New()
- color = pipe_color
- ..()
+ device_type = QUATERNARY
/obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections()
- return
-
-/obj/machinery/atmospherics/pipe/manifold4w/atmosinit()
- for(var/D in cardinal)
- for(var/obj/machinery/atmospherics/target in get_step(src, D))
- if(target.initialize_directions & get_dir(target,src))
- if(D == NORTH)
- node1 = target
- else if(D == SOUTH)
- node2 = target
- else if(D == EAST)
- node3 = target
- else if(D == WEST)
- node4 = target
- break
-
- var/turf/T = src.loc // hide if turf is not intact
- hide(T.intact)
- update_icon()
- ..()
-
-/obj/machinery/atmospherics/pipe/manifold4w/hide(i)
- if(level == 1 && istype(loc, /turf/simulated))
- invisibility = i ? 101 : 0
- update_icon()
-
-/obj/machinery/atmospherics/pipe/manifold4w/pipeline_expansion()
- return list(node1, node2, node3, node4)
-
-/obj/machinery/atmospherics/pipe/manifold4w/Destroy()
- if(node1)
- var/obj/machinery/atmospherics/A = node1
- node1.disconnect(src)
- node1 = null
- A.build_network()
- if(node2)
- var/obj/machinery/atmospherics/A = node2
- node2.disconnect(src)
- node2 = null
- A.build_network()
- if(node3)
- var/obj/machinery/atmospherics/A = node3
- node3.disconnect(src)
- node3 = null
- A.build_network()
- if(node4)
- var/obj/machinery/atmospherics/A = node4
- node4.disconnect(src)
- node4 = null
- A.build_network()
- releaseAirToTurf()
- return ..()
-
-/obj/machinery/atmospherics/pipe/manifold4w/disconnect(obj/machinery/atmospherics/reference)
- if(reference == node1)
- if(istype(node1, /obj/machinery/atmospherics/pipe))
- qdel(parent)
- node1 = null
- if(reference == node2)
- if(istype(node2, /obj/machinery/atmospherics/pipe))
- qdel(parent)
- node2 = null
- if(reference == node3)
- if(istype(node3, /obj/machinery/atmospherics/pipe))
- qdel(parent)
- node3 = null
- if(reference == node4)
- if(istype(node4, /obj/machinery/atmospherics/pipe))
- qdel(parent)
- node4 = null
- update_icon()
- ..()
+ initialize_directions = initial(initialize_directions)
/obj/machinery/atmospherics/pipe/manifold4w/update_icon()
- if(!node1 && !node2 && !node3 && !node4) //Remove us if we ain't connected to anything.
- qdel(src)
- return
-
var/invis = invisibility ? "-f" : ""
icon_state = "manifold4w_center[invis]"
@@ -111,28 +25,9 @@
overlays.Cut()
//Add non-broken pieces
- if(node1)
- overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", NORTH)
-
- if(node2)
- overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", SOUTH)
-
- if(node3)
- overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", EAST)
-
- if(node4)
- overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", WEST)
-
-/obj/machinery/atmospherics/pipe/manifold4w/update_node_icon()
- ..()
- if(node1)
- node1.update_icon()
- if(node2)
- node2.update_icon()
- if(node3)
- node3.update_icon()
- if(node4)
- node4.update_icon()
+ for(DEVICE_TYPE_LOOP)
+ if(NODE_I)
+ overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src, NODE_I))
//Colored pipes, use these for mapping
/obj/machinery/atmospherics/pipe/manifold4w/general
diff --git a/code/ATMOSPHERICS/pipes/pipes.dm b/code/ATMOSPHERICS/pipes/pipes.dm
index 5825da05ce9..3930cca92d9 100644
--- a/code/ATMOSPHERICS/pipes/pipes.dm
+++ b/code/ATMOSPHERICS/pipes/pipes.dm
@@ -1,7 +1,10 @@
/obj/machinery/atmospherics/pipe
var/datum/gas_mixture/air_temporary //used when reconstructing a pipeline that broke
var/volume = 0
+
+ level = 1
layer = 2.4 //under wires with their 2.44
+
use_power = 0
can_unwrench = 1
var/datum/pipeline/parent = null
@@ -11,8 +14,32 @@
buckle_requires_restraints = 1
buckle_lying = -1
-/obj/machinery/atmospherics/proc/pipeline_expansion()
- return null
+/obj/machinery/atmospherics/pipe/New()
+ color = pipe_color
+ ..()
+
+/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)
+ icon_state = "intact[invisibility ? "-f" : "" ]"
+ else
+ var/have_node1 = NODE1?1:0
+ var/have_node2 = NODE2?1:0
+ icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]"
+
+/obj/machinery/atmospherics/pipe/atmosinit()
+ var/turf/T = loc // hide if turf is not intact
+ hide(T.intact)
+ ..()
+
+/obj/machinery/atmospherics/pipe/hide(i)
+ if(level == 1 && istype(loc, /turf/simulated))
+ invisibility = i ? 101 : 0
+ update_icon()
/obj/machinery/atmospherics/pipe/proc/check_pressure(pressure)
//Return 1 if parent should continue checking other pipes
@@ -50,14 +77,24 @@
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)
var/obj/item/pipe_meter/PM = new (T)
meter.transfer_fingerprints_to(PM)
qdel(meter)
- return ..()
+ . = ..()
+
+ if(parent && !parent.gc_destroyed)
+ qdel(parent)
+ parent = null
/obj/machinery/atmospherics/pipe/proc/update_node_icon()
- //Used for pipe painting. Overriden in the children.
- return
+ for(DEVICE_TYPE_LOOP)
+ if(NODE_I)
+ var/obj/machinery/atmospherics/N = NODE_I
+ N.update_icon()
diff --git a/code/ATMOSPHERICS/pipes/simple.dm b/code/ATMOSPHERICS/pipes/simple.dm
index 586b6eb16d1..2830f75f804 100644
--- a/code/ATMOSPHERICS/pipes/simple.dm
+++ b/code/ATMOSPHERICS/pipes/simple.dm
@@ -1,4 +1,3 @@
-
/*
Simple Pipe
The regular pipe you see everywhere, including bent ones.
@@ -16,108 +15,30 @@ The regular pipe you see everywhere, including bent ones.
dir = SOUTH
initialize_directions = SOUTH|NORTH
- var/obj/machinery/atmospherics/node1
- var/obj/machinery/atmospherics/node2
-
- level = 1
-
-/obj/machinery/atmospherics/pipe/simple/New()
- color = pipe_color
-
- ..()
-
+ device_type = BINARY
/obj/machinery/atmospherics/pipe/simple/SetInitDirections()
+ if(dir in diagonals)
+ initialize_directions = dir
switch(dir)
- if(NORTH)
+ if(NORTH,SOUTH)
initialize_directions = SOUTH|NORTH
- if(SOUTH)
- initialize_directions = SOUTH|NORTH
- if(EAST)
+ if(EAST,WEST)
initialize_directions = EAST|WEST
- if(WEST)
- initialize_directions = EAST|WEST
- if(NORTHEAST)
- initialize_directions = NORTH|EAST
- if(NORTHWEST)
- initialize_directions = NORTH|WEST
- if(SOUTHEAST)
- initialize_directions = SOUTH|EAST
- if(SOUTHWEST)
- initialize_directions = SOUTH|WEST
/obj/machinery/atmospherics/pipe/simple/atmosinit()
normalize_dir()
- var/N = 2
- for(var/D in cardinal)
- if(D & initialize_directions)
- N--
- for(var/obj/machinery/atmospherics/target in get_step(src, D))
- if(target.initialize_directions & get_dir(target,src))
- if(!node1 && N == 1)
- node1 = target
- break
- if(!node2 && N == 0)
- node2 = target
- break
- var/turf/T = loc // hide if turf is not intact
- hide(T.intact)
- update_icon()
..()
-/obj/machinery/atmospherics/pipe/simple/Destroy()
- if(node1)
- var/obj/machinery/atmospherics/A = node1
- node1.disconnect(src)
- node1 = null
- A.build_network()
- if(node2)
- var/obj/machinery/atmospherics/A = node2
- node2.disconnect(src)
- node2 = null
- A.build_network()
- releaseAirToTurf()
- return ..()
-
-/obj/machinery/atmospherics/pipe/simple/disconnect(obj/machinery/atmospherics/reference)
- if(reference == node1)
- if(istype(node1, /obj/machinery/atmospherics/pipe))
- qdel(parent)
- node1 = null
- if(reference == node2)
- if(istype(node2, /obj/machinery/atmospherics/pipe))
- qdel(parent)
- node2 = null
- update_icon()
-
/obj/machinery/atmospherics/pipe/simple/proc/normalize_dir()
- if(dir==2)
- dir = 1
- else if(dir==8)
- dir = 4
+ if(dir==SOUTH)
+ dir = NORTH
+ else if(dir==WEST)
+ dir = EAST
/obj/machinery/atmospherics/pipe/simple/update_icon()
- if(node1&&node2)
- icon_state = "intact[invisibility ? "-f" : "" ]"
- else
- var/have_node1 = node1?1:0
- var/have_node2 = node2?1:0
- icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]"
-
-/obj/machinery/atmospherics/pipe/simple/hide(i)
- if(level == 1 && istype(loc, /turf/simulated))
- invisibility = i ? 101 : 0
- update_icon()
-
-/obj/machinery/atmospherics/pipe/simple/pipeline_expansion()
- return list(node1, node2)
-
-/obj/machinery/atmospherics/pipe/simple/update_node_icon()
+ normalize_dir()
..()
- if(node1)
- node1.update_icon()
- if(node2)
- node2.update_icon()
//Colored pipes, use these for mapping
/obj/machinery/atmospherics/pipe/simple/general
diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm
index 1745c74f2a2..c09cb0de0f6 100644
--- a/code/__DEFINES/atmospherics.dm
+++ b/code/__DEFINES/atmospherics.dm
@@ -106,9 +106,42 @@
#define PRESSURE_DAMAGE_COEFFICIENT 4 //The amount of pressure damage someone takes is equal to (pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE
#define MAX_HIGH_PRESSURE_DAMAGE 4 //This used to be 20... I got this much random rage for some retarded decision by polymorph?! Polymorph now lies in a pool of blood with a katana jammed in his spleen. ~Errorage --PS: The katana did less than 20 damage to him :(
#define LOW_PRESSURE_DAMAGE 2 //The amounb of damage someone takes when in a low pressure area (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value).
-
-#define COLD_SLOWDOWN_FACTOR 20 //Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this
+
+#define COLD_SLOWDOWN_FACTOR 20 //Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this
// Atmos pipe limits
#define MAX_OUTPUT_PRESSURE 4500 // (kPa) What pressure pumps and powered equipment max out at.
-#define MAX_TRANSFER_RATE 200 // (L/s) Maximum speed powered equipment can work at.
\ No newline at end of file
+#define MAX_TRANSFER_RATE 200 // (L/s) Maximum speed powered equipment can work at.
+
+//Atmos machinery pipenet stuff
+
+// used for device_type vars; used by DEVICE_TYPE_LOOP
+#define UNARY 1
+#define BINARY 2
+#define TRINARY 3
+#define QUATERNARY 4
+
+// this is the standard for loop used by all sorts of atmos machinery procs
+#define DEVICE_TYPE_LOOP var/I = 1; I <= device_type; I++
+
+// defines for the various machinery lists
+// NODE_I, AIR_I, PARENT_I are used within DEVICE_TYPE_LOOP
+
+// nodes list - all atmos machinery
+#define NODE1 nodes[1]
+#define NODE2 nodes[2]
+#define NODE3 nodes[3]
+#define NODE4 nodes[4]
+#define NODE_I nodes[I]
+
+// airs list - components only
+#define AIR1 airs[1]
+#define AIR2 airs[2]
+#define AIR3 airs[3]
+#define AIR_I airs[I]
+
+// parents list - components only
+#define PARENT1 parents[1]
+#define PARENT2 parents[2]
+#define PARENT3 parents[3]
+#define PARENT_I parents[I]
\ No newline at end of file
diff --git a/code/__DEFINES/pipe_construction.dm b/code/__DEFINES/pipe_construction.dm
index 0fc337db1d2..f04e8a32ee9 100644
--- a/code/__DEFINES/pipe_construction.dm
+++ b/code/__DEFINES/pipe_construction.dm
@@ -8,8 +8,8 @@ Construction breaks otherwise
#define PIPE_SIMPLE /obj/machinery/atmospherics/pipe/simple
#define PIPE_MANIFOLD /obj/machinery/atmospherics/pipe/manifold
#define PIPE_4WAYMANIFOLD /obj/machinery/atmospherics/pipe/manifold4w
-#define PIPE_HE /obj/machinery/atmospherics/pipe/simple/heat_exchanging
-#define PIPE_JUNCTION /obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction
+#define PIPE_HE /obj/machinery/atmospherics/pipe/heat_exchanging/simple
+#define PIPE_JUNCTION /obj/machinery/atmospherics/pipe/heat_exchanging/junction
//Unary
#define PIPE_CONNECTOR /obj/machinery/atmospherics/components/unary/portables_connector
#define PIPE_UVENT /obj/machinery/atmospherics/components/unary/vent_pump
diff --git a/code/_compile_options.dm b/code/_compile_options.dm
index a16c320eebf..a27192f7dc4 100644
--- a/code/_compile_options.dm
+++ b/code/_compile_options.dm
@@ -1,6 +1,5 @@
#define DEBUG //Enables byond profiling and full runtime logs - note, this may also be defined in your .dme file
-//#define TESTING //Enables in-depth debug messages to runtime log (used for debugging)
- //By using the testing("message") proc you can create debug-feedback for people with this
+//#define TESTING //Enables in-depth debug messages to runtime log (used for debugging) //By using the testing("message") proc you can create debug-feedback for people with this
//uncommented, but not visible in the release version)
#define PRELOAD_RSC 1 /*set to:
diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm
index ecd7ad159da..3f93766c026 100644
--- a/code/controllers/subsystem/garbage.dm
+++ b/code/controllers/subsystem/garbage.dm
@@ -25,6 +25,8 @@ var/datum/subsystem/garbage_collector/SSgarbage
var/list/didntgc = list() // list of all types that have failed to GC associated with the number of times that's happened.
// the types are stored as strings
+ var/list/noqdelhint = list()// list of all types that do not return a QDEL_HINT
+
/datum/subsystem/garbage_collector/New()
NEW_SS_GLOBAL(SSgarbage)
@@ -99,7 +101,6 @@ var/datum/subsystem/garbage_collector/SSgarbage
if (!A)
return
if (!istype(A))
- //warning("qdel() passed object of type [A.type]. qdel() can only handle /datum types.")
del(A)
else if (isnull(A.gc_destroyed))
// Let our friend know they're about to get fucked up.
@@ -120,14 +121,14 @@ var/datum/subsystem/garbage_collector/SSgarbage
if (QDEL_HINT_PUTINPOOL) //qdel will put this object in the pool.
PlaceInPool(A,0)
if (QDEL_HINT_FINDREFERENCE)//qdel will, if TESTING is enabled, display all references to this object, then queue the object for deletion.
- #ifdef TESTING
- A.to_be_queued = TRUE
- A.find_references()
- #else
SSgarbage.Queue(A)
+ #ifdef TESTING
+ A.find_references()
#endif
else
- testing("WARNING: \ref[A] \[[A.type]] is not returning a qdel hint. It is being placed in the queue.")
+ if(!("[A.type]" in SSgarbage.noqdelhint))
+ SSgarbage.noqdelhint += "[A.type]"
+ testing("WARNING: [A.type] is not returning a qdel hint. It is being placed in the queue. Further instances of this type will also be queued.")
SSgarbage.Queue(A)
// Returns 1 if the object has been queued for deletion.
@@ -150,7 +151,6 @@ var/datum/subsystem/garbage_collector/SSgarbage
#ifdef TESTING
/client/var/running_find_references
/datum/var/running_find_references
-/datum/var/to_be_queued = FALSE
/datum/verb/find_references()
set category = "Debug"
@@ -164,14 +164,18 @@ var/datum/subsystem/garbage_collector/SSgarbage
testing("CANCELLED search for references to a [usr.client.running_find_references].")
usr.client.running_find_references = null
running_find_references = null
+ //restart the garbage collector
+ SSgarbage.can_fire = 1
+ SSgarbage.next_fire = world.time + world.tick_lag
return
if(alert("Running this will create a lot of lag until it finishes. You can cancel it by running it again. Would you like to begin the search?", "Find References", "Yes", "No") == "No")
running_find_references = null
return
- // Remove this object from the list of things to be auto-deleted.
- if(SSgarbage && ("\ref[src]" in SSgarbage.queue))
- SSgarbage.queue -= "\ref[src]"
+
+ //this keeps the garbage collector from failing to collect objects being searched for in here
+ SSgarbage.can_fire = 0
+
if(usr && usr.client)
usr.client.running_find_references = type
@@ -196,9 +200,9 @@ var/datum/subsystem/garbage_collector/SSgarbage
usr.client.running_find_references = null
running_find_references = null
- if(to_be_queued == TRUE)
- to_be_queued = FALSE
- SSgarbage.Queue(src)
+ //restart the garbage collector
+ SSgarbage.can_fire = 1
+ SSgarbage.next_fire = world.time + world.tick_lag
/client/verb/purge_all_destroyed_objects()
set category = "Debug"
@@ -218,6 +222,5 @@ var/datum/subsystem/garbage_collector/SSgarbage
qdel(src)
if(!running_find_references)
- to_be_queued = TRUE //find_references removes the object from the queue;
- find_references() //this ensures the object will be queued again once find_references has completed
+ find_references()
#endif
\ No newline at end of file
diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm
index 17580deedec..5384871b48e 100644
--- a/code/game/machinery/atmoalter/portable_atmospherics.dm
+++ b/code/game/machinery/atmoalter/portable_atmospherics.dm
@@ -47,7 +47,7 @@
//Perform the connection
connected_port = new_port
connected_port.connected_device = src
- var/datum/pipeline/connected_port_parent = connected_port.parents[PARENT1]
+ var/datum/pipeline/connected_port_parent = connected_port.PARENT1
connected_port_parent.reconcile_air()
anchored = 1 //Prevent movement
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index 92f3e0ac1cf..d6d5034dcad 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -214,7 +214,6 @@ var/global/list/pipeID2State = list(
var/obj/machinery/atmospherics/components/trinary/T = A
if(istype(T))
T.flipped = flipped
-
A.construction(pipe_type, color)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm
index dd5fee98f6c..f6655f193c9 100644
--- a/code/modules/admin/verbs/atmosdebug.dm
+++ b/code/modules/admin/verbs/atmosdebug.dm
@@ -13,12 +13,12 @@
//Manifolds
for (var/obj/machinery/atmospherics/pipe/manifold/pipe in world)
- if (!pipe.node1 || !pipe.node2 || !pipe.node3)
+ if (!pipe.NODE1 || !pipe.NODE2 || !pipe.NODE3)
usr << "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])"
//Pipes
for (var/obj/machinery/atmospherics/pipe/simple/pipe in world)
- if (!pipe.node1 || !pipe.node2)
+ if (!pipe.NODE1 || !pipe.NODE2)
usr << "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])"
/client/proc/powerdebug()
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index 625200eb644..0a17da3fdce 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -120,7 +120,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
/client/proc/get_callproc_args()
var/argnum = input("Number of arguments","Number:",0) as num|null
if(!argnum && (argnum!=0)) return
-
+
var/list/lst = list()
//TODO: make a list to store whether each argument was initialised as null.
//Reason: So we can abort the proccall if say, one of our arguments was a mob which no longer exists
@@ -1100,6 +1100,10 @@ var/global/list/g_fancy_list_of_types = null
for(var/path in SSgarbage.didntgc)
dat += "[path] - [SSgarbage.didntgc[path]] times
"
+ dat += "List of paths that did not return a qdel hint in Destroy()
"
+ for(var/path in SSgarbage.noqdelhint)
+ dat += "[path]
"
+
usr << browse(dat, "window=dellog")
diff --git a/code/modules/mob/living/ventcrawling.dm b/code/modules/mob/living/ventcrawling.dm
index c0531581a36..a44e4865897 100644
--- a/code/modules/mob/living/ventcrawling.dm
+++ b/code/modules/mob/living/ventcrawling.dm
@@ -37,7 +37,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary
if(vent_found)
- var/datum/pipeline/vent_found_parent = vent_found.parents[PARENT1]
+ var/datum/pipeline/vent_found_parent = vent_found.PARENT1
if(vent_found_parent && (vent_found_parent.members.len || vent_found_parent.other_atmosmch))
visible_message("[src] begins climbing into the ventilation system..." ,"You begin climbing into the ventilation system...")
@@ -70,7 +70,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary
if(!istype(starting_machine) || !starting_machine.returnPipenet())
return
var/list/totalMembers = list()
- var/datum/pipeline/starting_machine_parent = starting_machine.parents[PARENT1]
+ var/datum/pipeline/starting_machine_parent = starting_machine.PARENT1
totalMembers += starting_machine_parent.members
totalMembers += starting_machine_parent.other_atmosmch
diff --git a/tgstation.dme b/tgstation.dme
index fec0366d291..5310c6088b5 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -122,11 +122,13 @@
#include "code\ATMOSPHERICS\components\unary_devices\unary_base.dm"
#include "code\ATMOSPHERICS\components\unary_devices\vent_pump.dm"
#include "code\ATMOSPHERICS\components\unary_devices\vent_scrubber.dm"
-#include "code\ATMOSPHERICS\pipes\he_pipes.dm"
#include "code\ATMOSPHERICS\pipes\manifold.dm"
#include "code\ATMOSPHERICS\pipes\manifold4w.dm"
#include "code\ATMOSPHERICS\pipes\pipes.dm"
#include "code\ATMOSPHERICS\pipes\simple.dm"
+#include "code\ATMOSPHERICS\pipes\heat_exchange\he_pipes.dm"
+#include "code\ATMOSPHERICS\pipes\heat_exchange\junction.dm"
+#include "code\ATMOSPHERICS\pipes\heat_exchange\simple.dm"
#include "code\controllers\configuration.dm"
#include "code\controllers\failsafe.dm"
#include "code\controllers\master_controller.dm"