]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix: clear health bar/icon overlay damage containers on update (#39288)
authorPerry Fraser <perryprog@users.noreply.github.com>
Sun, 11 Jan 2026 16:39:21 +0000 (11:39 -0500)
committerGitHub <noreply@github.com>
Sun, 11 Jan 2026 16:39:21 +0000 (16:39 +0000)
* fix: clear health overlay damage containers on update

* linqn't

* import

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Content.Client/Overlays/ShowHealthBarsSystem.cs
Content.Client/Overlays/ShowHealthIconsSystem.cs

index 9fefe93094efde524ca6ca8c20d346f65e862aab..a25e08d1fe925950bc7a6058ffc47cd2635cdce7 100644 (file)
@@ -1,8 +1,6 @@
 using Content.Shared.Inventory.Events;
 using Content.Shared.Overlays;
 using Robust.Client.Graphics;
-using System.Linq;
-using Robust.Client.Player;
 using Robust.Shared.Prototypes;
 
 namespace Content.Client.Overlays;
@@ -35,6 +33,9 @@ public sealed class ShowHealthBarsSystem : EquipmentHudSystem<ShowHealthBarsComp
     {
         base.UpdateInternal(component);
 
+        _overlay.DamageContainers.Clear();
+        _overlay.StatusIcon = null;
+
         foreach (var comp in component.Components)
         {
             foreach (var damageContainerId in comp.DamageContainers)
index 7fbc0cd944ab985c3e0f3b6edad14ed2d11afbc3..42697098cb6697ee2d263eb386fc7962905ad666 100644 (file)
@@ -5,7 +5,6 @@ using Content.Shared.Overlays;
 using Content.Shared.StatusIcon;
 using Content.Shared.StatusIcon.Components;
 using Robust.Shared.Prototypes;
-using System.Linq;
 using Content.Shared.Damage.Components;
 
 namespace Content.Client.Overlays;
@@ -32,9 +31,13 @@ public sealed class ShowHealthIconsSystem : EquipmentHudSystem<ShowHealthIconsCo
     {
         base.UpdateInternal(component);
 
-        foreach (var damageContainerId in component.Components.SelectMany(x => x.DamageContainers))
+        DamageContainers.Clear();
+        foreach (var comp in component.Components)
         {
-            DamageContainers.Add(damageContainerId);
+            foreach (var damageContainerId in comp.DamageContainers)
+            {
+                DamageContainers.Add(damageContainerId);
+            }
         }
     }