]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix cauterization spam from space damage (#32080)
authorthemias <89101928+themias@users.noreply.github.com>
Wed, 11 Sep 2024 16:05:54 +0000 (12:05 -0400)
committerGitHub <noreply@github.com>
Wed, 11 Sep 2024 16:05:54 +0000 (18:05 +0200)
Content.Server/Body/Components/BloodstreamComponent.cs
Content.Server/Body/Systems/BloodstreamSystem.cs

index a6d2afab2191a02e3d03974138d27f134fbfc254..a6c8ad90df97b39056b74e3610f23c29ac6161fa 100644 (file)
@@ -111,6 +111,13 @@ namespace Content.Server.Body.Components
         [DataField]
         public SoundSpecifier BloodHealedSound = new SoundPathSpecifier("/Audio/Effects/lightburn.ogg");
 
+        /// <summary>
+        /// 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.
+        /// </summary>
+        [DataField]
+        public float BloodHealedSoundThreshold = -0.1f;
+
         // TODO probably damage bleed thresholds.
 
         /// <summary>
index 3da343aaa8b001a2376eece9ad4b67f3d7d74898..18790e7326b6ca7220b4a226de462d6feea230e1 100644 (file)
@@ -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.