Skip to content

Commit

Permalink
[MIRROR] Fixes setOxyLoss() for humanoids
Browse files Browse the repository at this point in the history
  • Loading branch information
Qlonever authored and SuhEugene committed Nov 23, 2023
1 parent c1773b4 commit 2249904
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions code/modules/mob/living/carbon/human/human_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 2249904

Please sign in to comment.