diff --git a/Content.Shared/Armor/AllowSuitStorageComponent.cs b/Content.Shared/Armor/AllowSuitStorageComponent.cs index aa7bce1c87..23ddd89634 100644 --- a/Content.Shared/Armor/AllowSuitStorageComponent.cs +++ b/Content.Shared/Armor/AllowSuitStorageComponent.cs @@ -1,3 +1,5 @@ +using Content.Shared.Whitelist; + namespace Content.Shared.Armor; /// @@ -6,5 +8,12 @@ namespace Content.Shared.Armor; [RegisterComponent] public sealed partial class AllowSuitStorageComponent : Component { - + /// + /// Whitelist for what entities are allowed in the suit storage slot. + /// + [DataField] + public EntityWhitelist Whitelist = new() + { + Components = new[] {"Item"} + }; } diff --git a/Content.Shared/Inventory/InventorySystem.Equip.cs b/Content.Shared/Inventory/InventorySystem.Equip.cs index 7acfafee4a..324d6a7af0 100644 --- a/Content.Shared/Inventory/InventorySystem.Equip.cs +++ b/Content.Shared/Inventory/InventorySystem.Equip.cs @@ -248,9 +248,17 @@ public abstract partial class InventorySystem return false; if (slotDefinition.DependsOnComponents is { } componentRegistry) + { foreach (var (_, entry) in componentRegistry) + { if (!HasComp(slotEntity, entry.Component.GetType())) return false; + + if (TryComp(slotEntity, out var comp) && + _whitelistSystem.IsWhitelistFailOrNull(comp.Whitelist, itemUid)) + return false; + } + } } var fittingInPocket = slotDefinition.SlotFlags.HasFlag(SlotFlags.POCKET) &&