fix: clear health bar/icon overlay damage containers on update (#39288)

* fix: clear health overlay damage containers on update

* linqn't

* import

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
Perry Fraser 2026-01-11 11:39:21 -05:00 committed by BarryNorfolk
parent dcf776afe4
commit e3e6867491
2 changed files with 9 additions and 5 deletions

View 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)

View 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;
using Content.Shared.Mobs; // DeltaV - Nuke Health icons.
@ -33,9 +32,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);
}
}
}