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:
parent
dcf776afe4
commit
e3e6867491
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,11 +32,15 @@ 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)
|
||||
{
|
||||
foreach (var damageContainerId in comp.DamageContainers)
|
||||
{
|
||||
DamageContainers.Add(damageContainerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void DeactivateInternal()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue