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:
@@ -4,6 +4,7 @@ using Content.Shared.DoAfter;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -18,6 +19,7 @@ public abstract class SharedDevourSystem : EntitySystem
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
|
||||
[Dependency] protected readonly SharedContainerSystem ContainerSystem = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -41,7 +43,7 @@ public abstract class SharedDevourSystem : EntitySystem
|
||||
/// </summary>
|
||||
protected void OnDevourAction(EntityUid uid, DevourerComponent component, DevourActionEvent args)
|
||||
{
|
||||
if (args.Handled || component.Whitelist?.IsValid(args.Target, EntityManager) != true)
|
||||
if (args.Handled || _whitelistSystem.IsWhitelistFailOrNull(component.Whitelist, args.Target))
|
||||
return;
|
||||
|
||||
args.Handled = true;
|
||||
|
||||
Reference in New Issue
Block a user