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

@@ -7,6 +7,7 @@ using Content.Shared.Interaction;
using Content.Shared.Sticky;
using Content.Shared.Sticky.Components;
using Content.Shared.Verbs;
using Content.Shared.Whitelist;
using Robust.Shared.Containers;
using Robust.Shared.Utility;
@@ -20,6 +21,7 @@ public sealed class StickySystem : EntitySystem
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
private const string StickerSlotId = "stickers_container";
@@ -67,9 +69,8 @@ public sealed class StickySystem : EntitySystem
return false;
// check whitelist and blacklist
if (component.Whitelist != null && !component.Whitelist.IsValid(target))
return false;
if (component.Blacklist != null && component.Blacklist.IsValid(target))
if (_whitelistSystem.IsWhitelistFail(component.Whitelist, target) ||
_whitelistSystem.IsBlacklistPass(component.Blacklist, target))
return false;
var attemptEv = new AttemptEntityStickEvent(target, user);