Fixes organs not being removed due to damage

Because the dismemberment check was being done before brute_dam was
updated, the attack that actually brought brute_dam above the threshold
would not be able to pass the check, regardless of how much damage was
actually done.
This commit is contained in:
mwerezak
2014-07-14 23:59:10 -04:00
parent caee6afed8
commit f49e709394

View File

@@ -90,13 +90,6 @@
brute *= brmod //~2/3 damage for ROBOLIMBS
burn *= bumod //~2/3 damage for ROBOLIMBS
//If limb took enough damage, try to cut or tear it off
if(body_part != UPPER_TORSO && body_part != LOWER_TORSO) //as hilarious as it is, getting hit on the chest too much shouldn't effectively gib you.
if(config.limbs_can_break && brute_dam >= max_damage * config.organ_health_multiplier)
if( (edge && prob(5 * brute)) || (brute > 20 && prob(2 * brute)) )
droplimb(1)
return
// High brute damage or sharp objects may damage internal organs
if(internal_organs && ( (sharp && brute >= 5) || brute >= 10) && prob(5))
// Damage an internal organ
@@ -161,6 +154,14 @@
// sync the organ's damage with its wounds
src.update_damages()
//If limb took enough damage, try to cut or tear it off
if(body_part != UPPER_TORSO && body_part != LOWER_TORSO) //as hilarious as it is, getting hit on the chest too much shouldn't effectively gib you.
if(config.limbs_can_break && brute_dam >= max_damage * config.organ_health_multiplier)
if( (edge && prob(5 * brute)) || (brute > 20 && prob(2 * brute)) )
droplimb(1)
return
owner.updatehealth()
var/result = update_icon()