diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index a0661e921b6e8..16ccf53d7aae0 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -143,19 +143,18 @@ // Defined here solely to take species flags into account without having to recast at mob/living level. /mob/living/carbon/human/getOxyLoss() - if(!need_breathe()) + if (!need_breathe()) return 0 - else - var/obj/item/organ/internal/lungs/breathe_organ = internal_organs_by_name[species.breathing_organ] - if(!breathe_organ) - return maxHealth/2 - return breathe_organ.get_oxygen_deprivation() + var/obj/item/organ/internal/lungs/lungs = internal_organs_by_name[species.breathing_organ] + if (!lungs) + return 100 + return lungs.get_oxygen_deprivation() /mob/living/carbon/human/setOxyLoss(amount) - if(!need_breathe()) - return 0 - else - adjustOxyLoss(getOxyLoss()-amount) + if (!need_breathe()) + return + amount = clamp(amount, 0, 100) / 100 + adjustOxyLoss(amount * species.total_health) /mob/living/carbon/human/adjustOxyLoss(amount) if(!need_breathe())