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,5 +1,6 @@
using Content.Server.Objectives.Components;
using Content.Shared.Objectives.Components;
using Content.Shared.Whitelist;
namespace Content.Server.Objectives.Systems;
@@ -8,6 +9,7 @@ namespace Content.Server.Objectives.Systems;
/// </summary>
public sealed class RoleRequirementSystem : EntitySystem
{
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
public override void Initialize()
{
base.Initialize();
@@ -22,7 +24,7 @@ public sealed class RoleRequirementSystem : EntitySystem
// this whitelist trick only works because roles are components on the mind and not entities
// if that gets reworked then this will need changing
if (!comp.Roles.IsValid(args.MindId, EntityManager))
if (_whitelistSystem.IsWhitelistFail(comp.Roles, args.MindId))
args.Cancelled = true;
}
}