Replace obsolete EntityWhitelist IsValid usages part 2 (#28506)
This commit is contained in:
@@ -11,6 +11,7 @@ using Content.Shared.Item;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Strip.Components;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -30,6 +31,7 @@ public abstract partial class InventorySystem
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
[ValidatePrototypeId<ItemSizePrototype>]
|
||||
private const string PocketableItemSize = "Small";
|
||||
@@ -267,13 +269,8 @@ public abstract partial class InventorySystem
|
||||
return false;
|
||||
}
|
||||
|
||||
if (slotDefinition.Whitelist != null && !slotDefinition.Whitelist.IsValid(itemUid))
|
||||
{
|
||||
reason = "inventory-component-can-equip-does-not-fit";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (slotDefinition.Blacklist != null && slotDefinition.Blacklist.IsValid(itemUid))
|
||||
if (_whitelistSystem.IsWhitelistFail(slotDefinition.Whitelist, itemUid) ||
|
||||
_whitelistSystem.IsBlacklistPass(slotDefinition.Blacklist, itemUid))
|
||||
{
|
||||
reason = "inventory-component-can-equip-does-not-fit";
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user