From: themias <89101928+themias@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:05:54 +0000 (-0400) Subject: Fix cauterization spam from space damage (#32080) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=f2f76f711dcd52ab2a1ea86ca13440b8f49dd733;p=space-station-14.git Fix cauterization spam from space damage (#32080) --- diff --git a/Content.Server/Body/Components/BloodstreamComponent.cs b/Content.Server/Body/Components/BloodstreamComponent.cs index a6d2afab21..a6c8ad90df 100644 --- a/Content.Server/Body/Components/BloodstreamComponent.cs +++ b/Content.Server/Body/Components/BloodstreamComponent.cs @@ -111,6 +111,13 @@ namespace Content.Server.Body.Components [DataField] public SoundSpecifier BloodHealedSound = new SoundPathSpecifier("/Audio/Effects/lightburn.ogg"); + /// + /// The minimum amount damage reduction needed to play the healing sound/popup. + /// This prevents tiny amounts of heat damage from spamming the sound, e.g. spacing. + /// + [DataField] + public float BloodHealedSoundThreshold = -0.1f; + // TODO probably damage bleed thresholds. /// diff --git a/Content.Server/Body/Systems/BloodstreamSystem.cs b/Content.Server/Body/Systems/BloodstreamSystem.cs index 3da343aaa8..18790e7326 100644 --- a/Content.Server/Body/Systems/BloodstreamSystem.cs +++ b/Content.Server/Body/Systems/BloodstreamSystem.cs @@ -241,7 +241,7 @@ public sealed class BloodstreamSystem : EntitySystem } // Heat damage will cauterize, causing the bleed rate to be reduced. - else if (totalFloat < 0 && oldBleedAmount > 0) + else if (totalFloat <= ent.Comp.BloodHealedSoundThreshold && oldBleedAmount > 0) { // Magically, this damage has healed some bleeding, likely // because it's burn damage that cauterized their wounds.