remove mind roles from EntityWhitelist (#36089)
* remove mind roles from EntityWhitelist * remove redundant dependency
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Tag;
|
||||
|
||||
namespace Content.Shared.Whitelist;
|
||||
@@ -8,7 +7,6 @@ namespace Content.Shared.Whitelist;
|
||||
public sealed class EntityWhitelistSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IComponentFactory _factory = default!;
|
||||
[Dependency] private readonly SharedRoleSystem _roles = default!;
|
||||
[Dependency] private readonly TagSystem _tag = default!;
|
||||
|
||||
private EntityQuery<ItemComponent> _itemQuery;
|
||||
@@ -57,22 +55,6 @@ public sealed class EntityWhitelistSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
if (list.MindRoles != null)
|
||||
{
|
||||
var regs = StringsToRegs(list.MindRoles);
|
||||
|
||||
foreach (var role in regs)
|
||||
{
|
||||
if ( _roles.MindHasRole(uid, role.Type, out _))
|
||||
{
|
||||
if (!list.RequireAll)
|
||||
return true;
|
||||
}
|
||||
else if (list.RequireAll)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (list.Registrations != null && list.Registrations.Count > 0)
|
||||
{
|
||||
foreach (var reg in list.Registrations)
|
||||
|
||||
Reference in New Issue
Block a user