mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
medibot player injection Co-authored-by: YourUsername <you@example.com> (cherry picked from commit aea4e3cdbd722e0bc80407cb1652715b4775293c)
25 lines
718 B
C#
25 lines
718 B
C#
using Content.Shared.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)
|
|
{
|
|
var query = EntityQueryEnumerator<NPCRecentlyInjectedComponent>();
|
|
while (query.MoveNext(out var uid, out var entity))
|
|
{
|
|
entity.Accumulator += frameTime;
|
|
if (entity.Accumulator < entity.RemoveTime.TotalSeconds)
|
|
continue;
|
|
entity.Accumulator = 0;
|
|
|
|
RemComp<NPCRecentlyInjectedComponent>(uid);
|
|
}
|
|
}
|
|
}
|