From da5518f8b239213fb8761f9d8286c7b07f6045bd Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 13 Apr 2015 16:38:33 -0400 Subject: [PATCH] Updates various dependencies on organ brokenness to use the is_broken() proc. Updates external organ brokenness to ensure broken description is set. --- code/modules/mob/living/carbon/human/human_organs.dm | 2 +- code/modules/mob/living/carbon/shock.dm | 6 +----- code/modules/organs/organ.dm | 2 +- code/modules/organs/organ_external.dm | 6 +++++- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index de7a982b1a..a2bd080f84 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -74,7 +74,7 @@ stance_damage += 2 else if (E.status & ORGAN_DESTROYED) stance_damage += 2 // let it fail even if just foot&leg - else if (E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)) || !E.is_usable()) + else if (E.is_malfunctioning() || E.is_broken() || !E.is_usable()) stance_damage += 1 // Canes and crutches help you stand (if the latter is ever added) diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm index a83e76ef76..b020bf0a54 100644 --- a/code/modules/mob/living/carbon/shock.dm +++ b/code/modules/mob/living/carbon/shock.dm @@ -36,12 +36,8 @@ if(istype(src,/mob/living/carbon/human)) var/mob/living/carbon/human/M = src for(var/obj/item/organ/external/organ in M.organs) - if (!organ) - continue - else if(organ.status & ORGAN_BROKEN || organ.open) + if(organ && (organ.is_broken() || organ.open)) src.traumatic_shock += 30 - if(organ.status & ORGAN_SPLINTED) - src.traumatic_shock -= 25 if(src.traumatic_shock < 0) src.traumatic_shock = 0 diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index f97df89080..640daa3e7d 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -145,7 +145,7 @@ var/list/organ_cache = list() return damage >= min_bruised_damage /obj/item/organ/proc/is_broken() - return (damage >= min_broken_damage || (status & ORGAN_CUT_AWAY) || ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED))) + return (damage >= min_broken_damage || (status & ORGAN_CUT_AWAY) || (status & ORGAN_BROKEN)) //Germs /obj/item/organ/proc/handle_antibiotics() diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 43132ecb0b..e047699334 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -333,8 +333,12 @@ This function completely restores a damaged organ to perfect condition. PROCESSING & UPDATING ****************************************************/ -//Determines if we even need to process this organ. +//external organs handle brokenness a bit differently when it comes to damage. Instead brute_dam is checked inside process() +//this also ensures that an external organ cannot be "broken" without broken_description being set. +/obj/item/organ/external/is_broken() + return ((status & ORGAN_CUT_AWAY) || ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED))) +//Determines if we even need to process this organ. /obj/item/organ/external/proc/need_process() if(status && status != ORGAN_ROBOT) // If it's robotic, that's fine it will have a status. return 1