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

@@ -9,6 +9,7 @@ using Content.Shared.Interaction;
using Content.Shared.Inventory.Events;
using Content.Shared.Mind;
using Content.Shared.Rejuvenate;
using Content.Shared.Whitelist;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
@@ -29,6 +30,7 @@ public abstract class SharedActionsSystem : EntitySystem
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
public override void Initialize()
{
@@ -477,7 +479,7 @@ public abstract class SharedActionsSystem : EntitySystem
if (!target.IsValid() || Deleted(target))
return false;
if (action.Whitelist != null && !action.Whitelist.IsValid(target, EntityManager))
if (_whitelistSystem.IsWhitelistFail(action.Whitelist, target))
return false;
if (action.CheckCanInteract && !_actionBlockerSystem.CanInteract(user, target))