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

@@ -8,6 +8,7 @@ using Content.Shared.Mobs;
using Content.Shared.Popups;
using Content.Shared.Sound.Components;
using Content.Shared.Throwing;
using Content.Shared.Whitelist;
using JetBrains.Annotations;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
@@ -34,6 +35,7 @@ public abstract class SharedEmitSoundSystem : EntitySystem
[Dependency] private readonly SharedAmbientSoundSystem _ambient = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
[Dependency] protected readonly SharedPopupSystem Popup = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
public override void Initialize()
{
@@ -123,7 +125,7 @@ public abstract class SharedEmitSoundSystem : EntitySystem
private void OnEmitSoundOnInteractUsing(Entity<EmitSoundOnInteractUsingComponent> ent, ref InteractUsingEvent args)
{
if (ent.Comp.Whitelist.IsValid(args.Used, EntityManager))
if (_whitelistSystem.IsWhitelistPass(ent.Comp.Whitelist, args.Used))
{
TryEmitSound(ent, ent.Comp, args.User);
}