Replace obsolete EntityWhitelist IsValid usages part 2 (#28506)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Content.Shared.Storage.EntitySystems;
|
||||
using Content.Shared.Whitelist;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
@@ -9,6 +10,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
[UsedImplicitly]
|
||||
public sealed class ItemCounterSystem : SharedItemCounterSystem
|
||||
{
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
protected override int? GetCount(ContainerModifiedMessage msg, ItemCounterComponent itemCounter)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(msg.Container.Owner, out StorageComponent? component))
|
||||
@@ -19,7 +21,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
var count = 0;
|
||||
foreach (var entity in component.Container.ContainedEntities)
|
||||
{
|
||||
if (itemCounter.Count.IsValid(entity))
|
||||
if (_whitelistSystem.IsWhitelistPass(itemCounter.Count, entity))
|
||||
count++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user