Fixes bleeding checks not respecting merged wounds

This commit is contained in:
unknown
2014-06-16 18:49:20 -04:00
committed by ZomgPonies
parent 37ff8e4175
commit b215859357
2 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -407,7 +407,7 @@ This function completely restores a damaged organ to perfect condition.
var/heal_amt = 0
// if damage >= 50 AFTER treatment then it's probably too severe to heal within the timeframe of a round.
if (W.is_treated() && W.damage < 50)
if (W.is_treated() && W.wound_damage() < 50)
heal_amt += 0.5
//we only update wounds once in [wound_update_accuracy] ticks so have to emulate realtime
+7 -3
View File
@@ -81,10 +81,14 @@
src.min_damage = damage_list[current_stage]
src.desc = desc_list[current_stage]
// the amount of damage per wound
proc/wound_damage()
return src.damage / src.amount
// checks whether the wound has been appropriately treated
// always returns 1 for wounds that are too minor to need treatment
proc/is_treated()
if(src.damage / src.amount <= autoheal_cutoff)
if(src.wound_damage() <= autoheal_cutoff)
return 1
if(damage_type == BRUISE || damage_type == CUT)
@@ -142,7 +146,7 @@
amount -= healed_damage
src.damage -= healed_damage
while(src.damage / src.amount < damage_list[current_stage] && current_stage < src.desc_list.len)
while(src.wound_damage() < damage_list[current_stage] && current_stage < src.desc_list.len)
current_stage++
desc = desc_list[current_stage]
src.min_damage = damage_list[current_stage]
@@ -182,7 +186,7 @@
proc/bleeding()
// internal wounds don't bleed in the sense of this function
return ((damage > 30 || bleed_timer > 0) && !(bandaged||clamped) && (damage_type == BRUISE && damage >= 20 || damage_type == CUT && damage >= 5) && current_stage <= max_bleeding_stage && !src.internal)
return ((wound_damage() > 30 || bleed_timer > 0) && !(bandaged||clamped) && (damage_type == BRUISE && wound_damage() >= 20 || damage_type == CUT && wound_damage() >= 5) && current_stage <= max_bleeding_stage && !src.internal)
/** CUTS **/
/datum/wound/cut/small