Replace obsolete EntityWhitelist IsValid usages part 2 (#28506)

This commit is contained in:
Plykiya
2024-06-03 14:40:03 -07:00
committed by GitHub
parent 2bd4f85966
commit c5ff647ca6
42 changed files with 141 additions and 91 deletions

View File

@@ -1,6 +1,7 @@
using Content.Server.Chat.Systems;
using Content.Server.Speech;
using Content.Server.Speech.Components;
using Content.Shared.Whitelist;
using Robust.Shared.Player;
using static Content.Server.Chat.Systems.ChatSystem;
@@ -9,7 +10,7 @@ namespace Content.Server.SurveillanceCamera;
public sealed class SurveillanceCameraMicrophoneSystem : EntitySystem
{
[Dependency] private readonly SharedTransformSystem _xforms = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
public override void Initialize()
{
base.Initialize();
@@ -60,7 +61,7 @@ public sealed class SurveillanceCameraMicrophoneSystem : EntitySystem
public void CanListen(EntityUid uid, SurveillanceCameraMicrophoneComponent microphone, ListenAttemptEvent args)
{
// TODO maybe just make this a part of ActiveListenerComponent?
if (microphone.Blacklist.IsValid(args.Source))
if (_whitelistSystem.IsBlacklistPass(microphone.Blacklist, args.Source))
args.Cancel();
}