diff --git a/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs b/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs index d55ef355f02..948373940e4 100644 --- a/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs +++ b/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs @@ -247,7 +247,11 @@ public override void Update(float frameTime) var damageScale = MathF.Min(((pressure / Atmospherics.HazardHighPressure) - 1) * Atmospherics.PressureDamageCoefficient, Atmospherics.MaxHighPressureDamage); _damageableSystem.TryChangeDamage(uid, barotrauma.Damage * damageScale, true, false); - + if (!barotrauma.TakingDamage) + { + barotrauma.TakingDamage = true; + _adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} started taking high pressure damage"); + } _alertsSystem.ShowAlert(uid, AlertType.HighPressure, 2); } else @@ -258,11 +262,6 @@ public override void Update(float frameTime) barotrauma.TakingDamage = false; _adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} stopped taking pressure damage"); } - if (!barotrauma.TakingDamage) - { - barotrauma.TakingDamage = true; - _adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} started taking high pressure damage"); - } // Set correct alert. switch (pressure) { diff --git a/Content.Server/Body/Components/BloodstreamComponent.cs b/Content.Server/Body/Components/BloodstreamComponent.cs index 7a4af3e4cc1..76eadb99fd8 100644 --- a/Content.Server/Body/Components/BloodstreamComponent.cs +++ b/Content.Server/Body/Components/BloodstreamComponent.cs @@ -177,6 +177,7 @@ public sealed partial class BloodstreamComponent : Component /// If this is true, the entity will not passively regenerate blood, /// and instead will slowly lose blood. /// + [DataField] public bool HasBloodDeficiency = false; /// diff --git a/Content.Server/Body/Systems/BloodstreamSystem.cs b/Content.Server/Body/Systems/BloodstreamSystem.cs index fafc649eb29..b37ac5efeb4 100644 --- a/Content.Server/Body/Systems/BloodstreamSystem.cs +++ b/Content.Server/Body/Systems/BloodstreamSystem.cs @@ -120,12 +120,15 @@ public override void Update(float frameTime) // Removes blood for Blood Deficiency constantly. if (bloodstream.HasBloodDeficiency) + { if (!_mobStateSystem.IsDead(uid)) RemoveBlood(uid, bloodstream.BloodDeficiencyLossAmount, bloodstream); + } // Adds blood to their blood level if it is below the maximum. - else if (bloodSolution.Volume < bloodSolution.MaxVolume) - if (!_mobStateSystem.IsDead(uid)) - TryModifyBloodLevel(uid, bloodstream.BloodRefreshAmount, bloodstream); + else if (bloodSolution.Volume < 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. diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 742c9222745..5aca84c9f32 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -5041,3 +5041,15 @@ Entries: which can then be traced back to people. id: 6230 time: '2024-08-06T22:03:36.0000000+00:00' +- author: Skubman + changes: + - type: Fix + message: Passive blood regeneration now works again. + id: 6231 + time: '2024-08-07T06:07:35.0000000+00:00' +- author: Fansana + changes: + - type: Fix + message: Barotrauma admin log spam + id: 6232 + time: '2024-08-07T17:31:55.0000000+00:00'