remove mind roles from EntityWhitelist (#36089)

* remove mind roles from EntityWhitelist

* remove redundant dependency
This commit is contained in:
slarticodefast
2025-04-10 12:45:12 +02:00
committed by GitHub
parent dc6ed30ec8
commit f6bfce38da
10 changed files with 32 additions and 43 deletions

View File

@@ -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)