Files
tbd-station-14/Content.Server/NPC/Systems/NPCPerceptionSystem.RecentlyInjected.cs
metalgearsloth 0286b88388 NPC refactor (#10122)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-09-06 00:28:23 +10:00

24 lines
668 B
C#

using Content.Server.NPC.Components;
namespace Content.Server.NPC.Systems;
public sealed partial class NPCPerceptionSystem
{
/// <summary>
/// Tracks targets recently injected by medibots.
/// </summary>
/// <param name="frameTime"></param>
private void UpdateRecentlyInjected(float frameTime)
{
foreach (var entity in EntityQuery<NPCRecentlyInjectedComponent>())
{
entity.Accumulator += frameTime;
if (entity.Accumulator < entity.RemoveTime.TotalSeconds)
continue;
entity.Accumulator = 0;
RemComp<NPCRecentlyInjectedComponent>(entity.Owner);
}
}
}