diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm
index 61d7a48d5ff..b7444d00df8 100644
--- a/code/ATMOSPHERICS/datum_pipeline.dm
+++ b/code/ATMOSPHERICS/datum_pipeline.dm
@@ -1,3 +1,5 @@
+#define STEFAN_BOLTZMANN_CONSTANT 0.0000000567
+
datum/pipeline
var/datum/gas_mixture/air
@@ -209,5 +211,12 @@ datum/pipeline
(partial_heat_capacity*target.heat_capacity/(partial_heat_capacity+target.heat_capacity))
air.temperature -= heat/total_heat_capacity
+ if(network)
+ network.update = 1
+
+ proc/radiate_heat(surface, thermal_conductivity)
+ var/total_heat_capacity = air.heat_capacity()
+ var/heat = STEFAN_BOLTZMANN_CONSTANT * surface * air.temperature ** 4 * thermal_conductivity
+ air.temperature = max(0, air.temperature - heat / total_heat_capacity)
if(network)
network.update = 1
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/he_pipes.dm b/code/ATMOSPHERICS/he_pipes.dm
index 3fe69c855d4..a8e7e06bad6 100644
--- a/code/ATMOSPHERICS/he_pipes.dm
+++ b/code/ATMOSPHERICS/he_pipes.dm
@@ -4,6 +4,7 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging
icon_state = "intact"
level = 2
var/initialize_directions_he
+ var/surface = 2
minimum_temperature_difference = 20
thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT
@@ -49,12 +50,11 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging
else
var/datum/gas_mixture/environment = loc.return_air()
environment_temperature = environment.temperature
+ var/datum/gas_mixture/pipe_air = return_air()
+ if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
+ parent.temperature_interact(loc, volume, thermal_conductivity)
else
- environment_temperature = loc:temperature
- var/datum/gas_mixture/pipe_air = return_air()
- if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
- parent.temperature_interact(loc, volume, thermal_conductivity)
-
+ parent.radiate_heat(surface, 1)
obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index f6d12ea4c73..03401554555 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -294,6 +294,9 @@ update_flag
if (href_list["remove_tank"])
if(holding)
+ if (valve_open)
+ valve_open = 0
+ release_log += "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the [holding]
"
if(istype(holding, /obj/item/weapon/tank))
holding.manipulated_by = usr.real_name
holding.loc = loc
diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm
index 325f8917a3a..e6bd2151c8b 100644
--- a/code/modules/power/generator.dm
+++ b/code/modules/power/generator.dm
@@ -84,15 +84,17 @@
air2.temperature = air2.temperature + heat/air2_heat_capacity
air1.temperature = air1.temperature - energy_transfer/air1_heat_capacity
- //Transfer the air
- circ1.air2.merge(air1)
- circ2.air2.merge(air2)
+ //Transfer the air
+ if (air1)
+ circ1.air2.merge(air1)
+ if (air2)
+ circ2.air2.merge(air2)
- //Update the gas networks
- if(circ1.network2)
- circ1.network2.update = 1
- if(circ2.network2)
- circ2.network2.update = 1
+ //Update the gas networks
+ if(circ1.network2)
+ circ1.network2.update = 1
+ if(circ2.network2)
+ circ2.network2.update = 1
// update icon overlays and power usage only if displayed level has changed
if(lastgen > 250000 && prob(10))