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

@@ -15,6 +15,7 @@ using Content.Shared.Storage.Components;
using Content.Shared.Stunnable;
using Content.Shared.Throwing;
using Content.Shared.Verbs;
using Content.Shared.Whitelist;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Events;
using Robust.Shared.Utility;
@@ -24,6 +25,8 @@ namespace Content.Shared.Buckle;
public abstract partial class SharedBuckleSystem
{
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
private void InitializeBuckle()
{
SubscribeLocalEvent<BuckleComponent, ComponentStartup>(OnBuckleComponentStartup);
@@ -224,8 +227,8 @@ public abstract partial class SharedBuckleSystem
}
// Does it pass the Whitelist
if (strapComp.Whitelist != null &&
!strapComp.Whitelist.IsValid(buckleUid, EntityManager) || strapComp.Blacklist?.IsValid(buckleUid, EntityManager) == true)
if (_whitelistSystem.IsWhitelistFail(strapComp.Whitelist, buckleUid) ||
_whitelistSystem.IsBlacklistPass(strapComp.Blacklist, buckleUid))
{
if (_netManager.IsServer)
_popup.PopupEntity(Loc.GetString("buckle-component-cannot-fit-message"), userUid, buckleUid, PopupType.Medium);