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:
@@ -10,6 +10,7 @@ using Robust.Shared.Containers;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Robust.Server.Containers;
|
||||
using Content.Shared.Whitelist;
|
||||
|
||||
namespace Content.Server.Power.EntitySystems;
|
||||
|
||||
@@ -20,6 +21,7 @@ internal sealed class ChargerSystem : EntitySystem
|
||||
[Dependency] private readonly PowerCellSystem _powerCell = default!;
|
||||
[Dependency] private readonly BatterySystem _battery = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -208,7 +210,7 @@ internal sealed class ChargerSystem : EntitySystem
|
||||
if (!receiverComponent.Powered)
|
||||
return;
|
||||
|
||||
if (component.Whitelist?.IsValid(targetEntity, EntityManager) == false)
|
||||
if (_whitelistSystem.IsWhitelistFail(component.Whitelist, targetEntity))
|
||||
return;
|
||||
|
||||
if (!SearchForBattery(targetEntity, out var batteryUid, out var heldBattery))
|
||||
|
||||
Reference in New Issue
Block a user