Merge pull request #3319 from VOREStation/zero-pressure-water

Fix lung rupture while drowning in water.
This commit is contained in:
Neerti
2017-04-17 22:56:14 -04:00
committed by GitHub

View File

@@ -35,7 +35,16 @@
water_breath.temperature = above_air.temperature
return water_breath
else
return null // Lying down means they're submerged, which means no air.
var/gasid = "carbon_dioxide"
if(ishuman(L))
var/mob/living/carbon/human/H = L
if(H.species && H.species.exhale_type)
gasid = H.species.exhale_type
var/datum/gas_mixture/water_breath = new()
var/datum/gas_mixture/above_air = return_air()
water_breath.adjust_gas(gasid, BREATH_MOLES) // They have no oxygen, but non-zero moles and temp
water_breath.temperature = above_air.temperature
return water_breath
return return_air() // Otherwise their head is above the water, so get the air from the atmosphere instead.
/turf/simulated/floor/water/Entered(atom/movable/AM, atom/oldloc)