From b13ba13521881a5a0b0435f8eff04fe68826fa61 Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Tue, 30 May 2023 18:14:31 +0200 Subject: [PATCH] Fixes some cases where fakedeath doesn't work. (#16404) Co-authored-by: Matt Atlas --- code/datums/repositories/crew.dm | 4 +- code/modules/mob/living/carbon/human/human.dm | 3 ++ code/modules/organs/blood.dm | 2 +- code/modules/organs/internal/lungs.dm | 3 ++ .../mattatlas-stands_for_infinite.yml | 41 +++++++++++++++++++ 5 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 html/changelogs/mattatlas-stands_for_infinite.yml diff --git a/code/datums/repositories/crew.dm b/code/datums/repositories/crew.dm index 23519c64bc7..8dc4721ac0d 100644 --- a/code/datums/repositories/crew.dm +++ b/code/datums/repositories/crew.dm @@ -54,7 +54,7 @@ var/global/datum/repository/crew/crew_repository = new() if(H.should_have_organ(BP_HEART)) var/obj/item/organ/internal/heart/O = H.internal_organs_by_name[BP_HEART] if (!O || !BP_IS_ROBOTIC(O)) // Don't make medical freak out over prosthetic hearts - crewmemberData["tpulse"] = H.pulse() + crewmemberData["tpulse"] = H.status_flags & FAKEDEATH ? 0 : H.pulse() crewmemberData["pulse"] = H.get_pulse(GETPULSE_TOOL) else if(isipc(H) && H.internal_organs_by_name[BP_IPCTAG]) // Don't make untagged IPCs obvious @@ -114,4 +114,4 @@ var/global/datum/repository/crew/crew_repository = new() #undef OXYGENATION_STATE_LOW #undef OXYGENATION_STATE_VERY_LOW #undef OXYGENATION_STATE_NONE -#undef OXYGENATION_STATE_UNDEFINED \ No newline at end of file +#undef OXYGENATION_STATE_UNDEFINED diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 17c80bdd331..485c23bdefd 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1887,6 +1887,9 @@ // No heart, no pulse return "0" + if(status_flags & FAKEDEATH) + return "0" + var/bpm = get_pulse_as_number() if(bpm >= PULSE_MAX_BPM) return method ? ">[PULSE_MAX_BPM]" : "extremely weak and fast, patient's artery feels like a thread" diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index a25b842308d..d1d48182d9a 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -119,7 +119,7 @@ /mob/living/carbon/human/proc/get_blood_oxygenation() var/blood_volume = get_blood_circulation() - if(is_asystole()) // Heart is missing or isn't beating and we're not breathing (hardcrit) + if(is_asystole() || (status_flags & FAKEDEATH)) // Heart is missing or isn't beating and we're not breathing (hardcrit) return min(blood_volume, BLOOD_VOLUME_SURVIVE) if(!need_breathe()) diff --git a/code/modules/organs/internal/lungs.dm b/code/modules/organs/internal/lungs.dm index 2a54909191b..c783de5fb86 100644 --- a/code/modules/organs/internal/lungs.dm +++ b/code/modules/organs/internal/lungs.dm @@ -340,6 +340,9 @@ if(owner.failed_last_breath) return "no respiration" + if(owner.status_flags & FAKEDEATH) + return "no respiration" + if(BP_IS_ROBOTIC(src)) if(is_bruised()) return "malfunctioning fans" diff --git a/html/changelogs/mattatlas-stands_for_infinite.yml b/html/changelogs/mattatlas-stands_for_infinite.yml new file mode 100644 index 00000000000..dce34ccfae5 --- /dev/null +++ b/html/changelogs/mattatlas-stands_for_infinite.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fixed some more bugs with fakedeath sometimes not working properly."