Fix puncturase cauterizing bleeding (#38289)
fix puncturase cauterizing bleeding
This commit is contained in:
@@ -205,10 +205,13 @@ public sealed class BloodstreamSystem : EntitySystem
|
||||
}
|
||||
|
||||
// TODO probably cache this or something. humans get hurt a lot
|
||||
if (!_prototypeManager.TryIndex<DamageModifierSetPrototype>(ent.Comp.DamageBleedModifiers, out var modifiers))
|
||||
if (!_prototypeManager.TryIndex(ent.Comp.DamageBleedModifiers, out var modifiers))
|
||||
return;
|
||||
|
||||
var bloodloss = DamageSpecifier.ApplyModifierSet(args.DamageDelta, modifiers);
|
||||
// some reagents may deal and heal different damage types in the same tick, which means DamageIncreased will be true
|
||||
// but we only want to consider the dealt damage when causing bleeding
|
||||
var damage = DamageSpecifier.GetPositive(args.DamageDelta);
|
||||
var bloodloss = DamageSpecifier.ApplyModifierSet(damage, modifiers);
|
||||
|
||||
if (bloodloss.Empty)
|
||||
return;
|
||||
@@ -227,7 +230,7 @@ public sealed class BloodstreamSystem : EntitySystem
|
||||
var prob = Math.Clamp(totalFloat / 25, 0, 1);
|
||||
if (totalFloat > 0 && _robustRandom.Prob(prob))
|
||||
{
|
||||
TryModifyBloodLevel(ent, (-total) / 5, ent);
|
||||
TryModifyBloodLevel(ent, -total / 5, ent);
|
||||
_audio.PlayPvs(ent.Comp.InstantBloodSound, ent);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user