mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
27 lines
766 B
C#
27 lines
766 B
C#
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.IoC;
|
|
using Robust.Shared.Player;
|
|
|
|
namespace Robust.Client.Player
|
|
{
|
|
internal sealed class FilterSystem : SharedFilterSystem
|
|
{
|
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
|
|
|
public override Filter FromEntities(Filter filter, params EntityUid[] entities)
|
|
{
|
|
if (_playerManager.LocalPlayer is not { } localPlayer
|
|
|| localPlayer.Session.AttachedEntity is not {Valid: true} attachedUid)
|
|
return filter;
|
|
|
|
foreach (var uid in entities)
|
|
{
|
|
if (uid == attachedUid)
|
|
filter.AddPlayer(localPlayer.Session);
|
|
}
|
|
|
|
return filter;
|
|
}
|
|
}
|
|
}
|