Skip to content

Commit

Permalink
External bleeding sealing
Browse files Browse the repository at this point in the history
Fix blood_loss potentially granting blood
  • Loading branch information
Drulikar committed Apr 21, 2024
1 parent 789fd19 commit 2a32302
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions code/datums/effects/bleeding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
if(affected_mob.reagents.get_reagent_amount("thwei"))
blood_loss -= THWEI_BLOOD_REDUCTION

if(affected_mob.bodytemperature < T0C && (affected_mob.reagents.get_reagent_amount("cryoxadone") || affected_mob.reagents.get_reagent_amount("clonexadone")))
blood_loss -= CRYO_BLOOD_REDUCTION

var/mob/living/carbon/human/affected_human = affected_mob
if(istype(affected_human))
if(affected_human.chem_effect_flags & CHEM_EFFECT_NO_BLEEDING)
Expand All @@ -95,18 +98,19 @@
if(affected_mob.in_stasis == STASIS_IN_BAG)
return FALSE

if(affected_mob.bodytemperature < T0C && (affected_mob.reagents && affected_mob.reagents.get_reagent_amount("cryoxadone") || affected_mob.reagents.get_reagent_amount("clonexadone")))
blood_loss -= CRYO_BLOOD_REDUCTION

if(affected_mob.reagents) // Annoying QC check
if(affected_mob.reagents.get_reagent_amount("thwei"))
blood_loss -= THWEI_BLOOD_REDUCTION

if(affected_mob.bodytemperature < T0C && (affected_mob.reagents.get_reagent_amount("cryoxadone") || affected_mob.reagents.get_reagent_amount("clonexadone")))
blood_loss -= CRYO_BLOOD_REDUCTION

var/mob/living/carbon/human/affected_human = affected_mob
if(istype(affected_human))
if(affected_human.chem_effect_flags & CHEM_EFFECT_NO_BLEEDING)
return FALSE

blood_loss = max(blood_loss, 0) // Bleeding shouldn't give extra blood even if its only 1 tick
affected_mob.blood_volume = max(affected_mob.blood_volume - blood_loss, 0)

return TRUE
Expand Down

0 comments on commit 2a32302

Please sign in to comment.