Пример #1
0
        public override Filter FromEntities(Filter filter, params EntityUid[] entities)
        {
            foreach (var uid in entities)
            {
                if (EntityManager.TryGetComponent(uid, out ActorComponent? actor))
                {
                    filter.AddPlayer(actor.PlayerSession);
                }
            }

            return(filter);
        }
Пример #2
0
        public override Filter FromEntities(Filter filter, params EntityUid[] entities)
        {
            if (_playerManager.LocalPlayer is not {
            } localPlayer ||
                localPlayer.Session.AttachedEntityUid is not {
            } attachedUid)
            {
                return(filter);
            }

            foreach (var uid in entities)
            {
                if (uid == attachedUid)
                {
                    filter.AddPlayer(localPlayer.Session);
                }
            }

            return(filter);
        }