Merge pull request #9867 from RemieRichards/PipePressureLethality

Pipe Pressure Panic
This commit is contained in:
Cheridan
2015-06-23 00:16:25 -05:00
5 changed files with 95 additions and 7 deletions
@@ -160,4 +160,21 @@
if(Old == parent1)
parent1 = New
else if(Old == parent2)
parent2 = New
parent2 = New
/obj/machinery/atmospherics/binary/unsafe_pressure_release(var/mob/user,var/pressures)
..()
var/turf/T = get_turf(src)
if(T)
//Remove the gas from air1+air2 and assume it
var/datum/gas_mixture/environment = T.return_air()
var/lost = pressures*environment.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
lost += pressures*environment.volume/(air2.temperature * R_IDEAL_GAS_EQUATION)
var/shared_loss = lost/2
var/datum/gas_mixture/to_release = air1.remove(shared_loss)
to_release.merge(air2.remove(shared_loss))
T.assume_air(to_release)
air_update_turf(1)