From bef305dff1d5b05e8199f9e0687e8f0e8b1c7835 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 13 Dec 2014 19:50:12 -0500 Subject: [PATCH 1/2] Fixes handle_organs() being called twice in Life() --- code/modules/mob/living/carbon/human/life.dm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 18ccba8c0a7..bbc4acc0b99 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -95,8 +95,10 @@ //Disabilities handle_disabilities() - //Organ failure. + //Organs and blood handle_organs() + handle_blood() + stabilize_body_temperature() //Body temperature adjusts itself (self-regulation) //Random events (vomiting etc) handle_random_events() @@ -1096,10 +1098,6 @@ silent = 0 else //ALIVE. LIGHTS ARE ON updatehealth() //TODO - if(!in_stasis) - stabilize_body_temperature() //Body temperature adjusts itself - handle_organs() //Optimized. - handle_blood() if(health <= config.health_threshold_dead || (species.has_organ["brain"] && !has_brain())) death() From e01d056b75a1fc92174af54545a9b696f2c924ca Mon Sep 17 00:00:00 2001 From: mwerezak Date: Thu, 4 Sep 2014 17:33:02 -0400 Subject: [PATCH 2/2] Fixes #6240 --- code/modules/mob/living/carbon/human/life.dm | 49 ++++++++------------ 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index bbc4acc0b99..ee752a475db 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1067,22 +1067,6 @@ take_overall_damage(2,0) traumatic_shock++ - if (drowsyness) - drowsyness-- - eye_blurry = max(2, eye_blurry) - if (prob(5)) - sleeping += 1 - Paralyse(5) - - confused = max(0, confused - 1) - // decrement dizziness counter, clamped to 0 - if(resting) - dizziness = max(0, dizziness - 15) - jitteriness = max(0, jitteriness - 15) - else - dizziness = max(0, dizziness - 3) - jitteriness = max(0, jitteriness - 3) - if(!(species.flags & IS_SYNTHETIC)) handle_trace_chems() updatehealth() @@ -1112,13 +1096,6 @@ if( (getOxyLoss() > 50) || (config.health_threshold_crit > health) ) Paralyse(3) - /* Done by handle_breath() - if( health <= 20 && prob(1) ) - spawn(0) - emote("gasp") - if(!reagents.has_reagent("inaprovaline")) - adjustOxyLoss(1)*/ - if(hallucination) if(hallucination >= 20) if(prob(3)) @@ -1161,22 +1138,17 @@ if( prob(2) && health && !hal_crit ) spawn(0) emote("snore") - else if(resting) - if(halloss > 0) - adjustHalLoss(-3) //CONSCIOUS else stat = CONSCIOUS - if(halloss > 0) - adjustHalLoss(-1) + //Periodically double-check embedded_flag if(embedded_flag && !(life_tick % 10)) var/list/E E = get_visible_implants(0) if(!E.len) embedded_flag = 0 - //Eyes if(!species.has_organ["eyes"]) // Presumably if a species has no eyes, they see via something else. eye_blind = 0 @@ -1208,9 +1180,28 @@ else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs ear_damage = max(ear_damage-0.05, 0) + //Resting + if(resting) + dizziness = max(0, dizziness - 15) + jitteriness = max(0, jitteriness - 15) + adjustHalLoss(-3) + else + dizziness = max(0, dizziness - 3) + jitteriness = max(0, jitteriness - 3) + adjustHalLoss(-1) + //Other handle_statuses() + if (drowsyness) + drowsyness-- + eye_blurry = max(2, eye_blurry) + if (prob(5)) + sleeping += 1 + Paralyse(5) + + confused = max(0, confused - 1) + // If you're dirty, your gloves will become dirty, too. if(gloves && germ_level > gloves.germ_level && prob(10)) gloves.germ_level += 1