From 9fed22c056baaecd595680e732227a19da66e224 Mon Sep 17 00:00:00 2001 From: Mloc-Argent Date: Wed, 28 Aug 2013 18:49:00 +0100 Subject: [PATCH] Space no longer freezes mobs. Signed-off-by: Mloc-Argent --- code/game/turfs/space/space.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 57 ++++++++++---------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 95720295c87..4323ee0adb9 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -3,7 +3,7 @@ name = "\proper space" icon_state = "0" - temperature = TCMB + temperature = T0C thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT // heat_capacity = 700000 No. diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index d61cdd1cc7c..f5314954069 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -526,38 +526,37 @@ proc/handle_environment(datum/gas_mixture/environment) if(!environment) return - var/loc_temp = T0C - if(istype(loc, /obj/mecha)) - var/obj/mecha/M = loc - loc_temp = M.return_temperature() - else if(istype(get_turf(src), /turf/space)) - var/turf/heat_turf = get_turf(src) - loc_temp = heat_turf.temperature - else if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) - loc_temp = loc:air_contents.temperature - else - loc_temp = environment.temperature + if(!istype(get_turf(src), /turf/space)) //space is not meant to change your body temperature. + var/loc_temp = T0C + if(istype(loc, /obj/mecha)) + var/obj/mecha/M = loc + loc_temp = M.return_temperature() + else if(istype(get_turf(src), /turf/space)) + else if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) + loc_temp = loc:air_contents.temperature + else + loc_temp = environment.temperature - //world << "Loc temp: [loc_temp] - Body temp: [bodytemperature] - Fireloss: [getFireLoss()] - Thermal protection: [get_thermal_protection()] - Fire protection: [thermal_protection + add_fire_protection(loc_temp)] - Heat capacity: [environment_heat_capacity] - Location: [loc] - src: [src]" + //world << "Loc temp: [loc_temp] - Body temp: [bodytemperature] - Fireloss: [getFireLoss()] - Thermal protection: [get_thermal_protection()] - Fire protection: [thermal_protection + add_fire_protection(loc_temp)] - Heat capacity: [environment_heat_capacity] - Location: [loc] - src: [src]" - //Body temperature is adjusted in two steps. Firstly your body tries to stabilize itself a bit. - if(stat != 2) - stabilize_temperature_from_calories() + //Body temperature is adjusted in two steps. Firstly your body tries to stabilize itself a bit. + if(stat != 2) + stabilize_temperature_from_calories() -// log_debug("Adjusting to atmosphere.") - //After then, it reacts to the surrounding atmosphere based on your thermal protection - if(loc_temp < BODYTEMP_COLD_DAMAGE_LIMIT) //Place is colder than we are - var/thermal_protection = get_cold_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. - if(thermal_protection < 1) - var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX) -// log_debug("[loc_temp] is Cold. Cooling by [amt]") - bodytemperature += amt - else if (loc_temp > BODYTEMP_HEAT_DAMAGE_LIMIT) //Place is hotter than we are - var/thermal_protection = get_heat_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. - if(thermal_protection < 1) - var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX) -// log_debug("[loc_temp] is Heat. Heating up by [amt]") - bodytemperature += amt + // log_debug("Adjusting to atmosphere.") + //After then, it reacts to the surrounding atmosphere based on your thermal protection + if(loc_temp < BODYTEMP_COLD_DAMAGE_LIMIT) //Place is colder than we are + var/thermal_protection = get_cold_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. + if(thermal_protection < 1) + var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX) + // log_debug("[loc_temp] is Cold. Cooling by [amt]") + bodytemperature += amt + else if (loc_temp > BODYTEMP_HEAT_DAMAGE_LIMIT) //Place is hotter than we are + var/thermal_protection = get_heat_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. + if(thermal_protection < 1) + var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX) + // log_debug("[loc_temp] is Heat. Heating up by [amt]") + bodytemperature += amt // +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt. if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT)