diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm
index 0115c85c3dd..10cd0bec934 100644
--- a/code/ATMOSPHERICS/datum_pipeline.dm
+++ b/code/ATMOSPHERICS/datum_pipeline.dm
@@ -116,15 +116,17 @@ datum/pipeline
if(istype(target) && target.zone)
//Have to consider preservation of group statuses
var/datum/gas_mixture/turf_copy = new
+ var/datum/gas_mixture/turf_original = new
turf_copy.copy_from(target.zone.air)
turf_copy.volume = target.zone.air.volume //Copy a good representation of the turf from parent group
+ turf_original.copy_from(turf_copy)
equalize_gases(list(air_sample, turf_copy))
air.merge(air_sample)
- turf_copy.subtract(target.zone.air)
+ target.zone.air.remove(turf_original.total_moles)
target.zone.air.merge(turf_copy)
else
diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm
index 9566be9947e..11a18e251c5 100644
--- a/code/ATMOSPHERICS/pipes.dm
+++ b/code/ATMOSPHERICS/pipes.dm
@@ -72,8 +72,6 @@
/obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (istype(src, /obj/machinery/atmospherics/pipe/tank))
return ..()
- if (istype(src, /obj/machinery/atmospherics/pipe/vent))
- return ..()
if(istype(W,/obj/item/device/pipe_painter))
return 0
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index bd650755e5a..4547b4eaf37 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -55,6 +55,7 @@ Buildable meters
#define PIPE_DTVALVE 45
#define PIPE_DTVALVEM 46
+#define PIPE_PASSIVE_VENT 47
/obj/item/pipe
name = "pipe"
@@ -198,6 +199,8 @@ Buildable meters
else if(istype(make_from, /obj/machinery/atmospherics/pipe/zpipe/down))
src.pipe_type = PIPE_DOWN
///// Z-Level stuff
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/vent))
+ src.pipe_type = PIPE_PASSIVE_VENT
else
src.pipe_type = pipe_type
src.set_dir(dir)
@@ -272,6 +275,7 @@ Buildable meters
"dvalve", \
"dt-valve", \
"dt-valve m", \
+ "passive vent", \
)
name = nlist[pipe_type+1] + " fitting"
var/list/islist = list( \
@@ -325,6 +329,7 @@ Buildable meters
"dvalve", \
"dtvalve", \
"dtvalvem", \
+ "passive vent", \
)
icon_state = islist[pipe_type + 1]
@@ -414,6 +419,8 @@ Buildable meters
if(PIPE_UP,PIPE_DOWN,PIPE_SUPPLY_UP,PIPE_SUPPLY_DOWN,PIPE_SCRUBBERS_UP,PIPE_SCRUBBERS_DOWN)
return dir
///// Z-Level stuff
+ if(PIPE_PASSIVE_VENT)
+ return dir
return 0
/obj/item/pipe/proc/get_pdir() //endpoints for regular pipes
@@ -1230,6 +1237,17 @@ Buildable meters
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
+ if(PIPE_PASSIVE_VENT)
+ var/obj/machinery/atmospherics/pipe/vent/P = new(loc)
+ P.set_dir(dir)
+ P.initialize_directions = pipe_dir
+ var/turf/T = P.loc
+ P.level = !T.is_plating() ? 2 : 1
+ P.initialize()
+ P.build_network()
+ if (P.node1)
+ P.node1.initialize()
+ P.node1.build_network()
playsound(src, W.usesound, 50, 1)
user.visible_message( \
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index a9c2813a584..8bc779adf3e 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -46,6 +46,7 @@
Universal pipe adapter
Connector
Unary Vent
+Passive Vent
Gas Pump
Pressure Regulator
High Power Gas Pump