Replace obsolete EntityWhitelist IsValid usages (#28465)

* Replace obsolete whitelist is valid with whitelist system

* Consistency

* Fix logic

* Bork

* I figured out how to get whitelists on the client lol

* test fail

* woops

* HELP ME FUNCTIONS

* Fix errors

* simplify

---------

Co-authored-by: plykiya <plykiya@protonmail.com>
This commit is contained in:
Plykiya
2024-06-01 20:10:24 -07:00
committed by GitHub
parent dce68e48e8
commit d6ba166d3b
31 changed files with 186 additions and 56 deletions

View File

@@ -28,6 +28,7 @@ using Content.Shared.Revenant.Components;
using Robust.Shared.Physics.Components;
using Robust.Shared.Utility;
using Robust.Shared.Map.Components;
using Content.Shared.Whitelist;
namespace Content.Server.Revenant.EntitySystems;
@@ -40,6 +41,7 @@ public sealed partial class RevenantSystem
[Dependency] private readonly MobThresholdSystem _mobThresholdSystem = default!;
[Dependency] private readonly GhostSystem _ghost = default!;
[Dependency] private readonly TileSystem _tile = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
private void InitializeAbilities()
{
@@ -331,10 +333,8 @@ public sealed partial class RevenantSystem
foreach (var ent in _lookup.GetEntitiesInRange(uid, component.MalfunctionRadius))
{
if (component.MalfunctionWhitelist?.IsValid(ent, EntityManager) == false)
continue;
if (component.MalfunctionBlacklist?.IsValid(ent, EntityManager) == true)
if (_whitelistSystem.IsWhitelistFail(component.MalfunctionWhitelist, ent) ||
_whitelistSystem.IsBlacklistPass(component.MalfunctionBlacklist, ent))
continue;
_emag.DoEmagEffect(uid, ent); //it does not emag itself. adorable.