From 5ce82b0c71792ac7fb20b1be205b694561414ca1 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Sat, 10 May 2014 10:45:17 +0930 Subject: [PATCH] Fixes #4810 Conflicts: code/modules/mob/living/carbon/monkey/life.dm --- code/modules/mob/living/carbon/human/life.dm | 10 ++++++---- code/modules/mob/living/carbon/monkey/life.dm | 14 ++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index e8d4b4cb51e..ce65aad4209 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -606,6 +606,11 @@ proc/handle_environment(datum/gas_mixture/environment) if(!environment) return + + //Moved pressure calculations here for use in skip-processing check. + var/pressure = environment.return_pressure() + var/adjusted_pressure = calculate_affecting_pressure(pressure) + 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)) @@ -620,7 +625,7 @@ else loc_temp = environment.temperature - if(abs(loc_temp - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.toxins < MOLES_PLASMA_VISIBLE) + if(adjusted_pressure < species.warning_low_pressure && adjusted_pressure > species.warning_low_pressure && abs(loc_temp - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.toxins < MOLES_PLASMA_VISIBLE) return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp //Body temperature is adjusted in two steps. Firstly your body tries to stabilize itself a bit. @@ -674,9 +679,6 @@ // Account for massive pressure differences. Done by Polymorph // Made it possible to actually have something that can protect against high pressure... Done by Errorage. Polymorph now has an axe sticking from his head for his previous hardcoded nonsense! - - var/pressure = environment.return_pressure() - var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. if(status_flags & GODMODE) return 1 //godmode if(adjusted_pressure >= species.hazard_high_pressure) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index f5385fbafd3..86c14bfcbb3 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -391,7 +391,16 @@ if(!environment) return - if(abs(environment.temperature - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.toxins < MOLES_PLASMA_VISIBLE) + //Moved these vars here for use in the fuck-it-skip-processing check. + var/pressure = environment.return_pressure() + var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. + + if(adjusted_pressure < WARNING_HIGH_PRESSURE && adjusted_pressure > WARNING_LOW_PRESSURE && abs(environment.temperature - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.toxins < MOLES_PLASMA_VISIBLE) + + //Hopefully should fix the walk-inside-still-pressure-warning issue. + if(pressure_alert) + pressure_alert = 0 + return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp var/environment_heat_capacity = environment.heat_capacity() @@ -409,9 +418,6 @@ bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000) //Account for massive pressure differences - - var/pressure = environment.return_pressure() - var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. switch(adjusted_pressure) if(HAZARD_HIGH_PRESSURE to INFINITY) adjustBruteLoss( min( ( (adjusted_pressure / HAZARD_HIGH_PRESSURE) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) )