fixes crit people being seen as dead for bleed purposes (#16827)

This commit is contained in:
Whisper
2023-05-26 03:23:29 -04:00
committed by GitHub
parent ca8adf10aa
commit 0e8ac9ce79

View File

@@ -93,8 +93,10 @@ public sealed class BloodstreamSystem : EntitySystem
bloodstream.AccumulatedFrametime -= bloodstream.UpdateInterval;
// Adds blood to their blood level if it is below the maximum; Blood regeneration. Must be alive.
if (bloodstream.BloodSolution.Volume < bloodstream.BloodSolution.MaxVolume && _mobStateSystem.IsAlive(uid))
if (bloodstream.BloodSolution.Volume < bloodstream.BloodSolution.MaxVolume && !_mobStateSystem.IsDead(uid))
{
TryModifyBloodLevel(uid, bloodstream.BloodRefreshAmount, bloodstream);
}
// Removes blood from the bloodstream based on bleed amount (bleed rate)
// as well as stop their bleeding to a certain extent.
@@ -108,7 +110,7 @@ public sealed class BloodstreamSystem : EntitySystem
// deal bloodloss damage if their blood level is below a threshold.
var bloodPercentage = GetBloodLevelPercentage(uid, bloodstream);
if (bloodPercentage < bloodstream.BloodlossThreshold && _mobStateSystem.IsAlive(uid))
if (bloodPercentage < bloodstream.BloodlossThreshold && !_mobStateSystem.IsDead(uid))
{
// bloodloss damage is based on the base value, and modified by how low your blood level is.
var amt = bloodstream.BloodlossDamage / (0.1f + bloodPercentage);
@@ -124,7 +126,7 @@ public sealed class BloodstreamSystem : EntitySystem
// storing the drunk and stutter time so we can remove it independently from other effects additions
bloodstream.StatusTime += bloodstream.UpdateInterval * 2;
}
else if (_mobStateSystem.IsAlive(uid))
else if (!_mobStateSystem.IsDead(uid))
{
// If they're healthy, we'll try and heal some bloodloss instead.
_damageableSystem.TryChangeDamage(uid, bloodstream.BloodlossHealDamage * bloodPercentage, true, false);