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

@@ -22,6 +22,7 @@ using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Content.Shared.Whitelist;
namespace Content.Server.Mech.Systems;
@@ -36,6 +37,7 @@ public sealed partial class MechSystem : SharedMechSystem
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
/// <inheritdoc/>
@@ -224,7 +226,7 @@ public sealed partial class MechSystem : SharedMechSystem
if (args.Cancelled || args.Handled)
return;
if (component.PilotWhitelist != null && !component.PilotWhitelist.IsValid(args.User))
if (_whitelistSystem.IsWhitelistFail(component.PilotWhitelist, args.User))
{
_popup.PopupEntity(Loc.GetString("mech-no-enter", ("item", uid)), args.User);
return;