@@ -1,3 +1,5 @@
|
|||||||
|
using Content.Shared.Whitelist;
|
||||||
|
|
||||||
namespace Content.Shared.Armor;
|
namespace Content.Shared.Armor;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -6,5 +8,12 @@ namespace Content.Shared.Armor;
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public sealed partial class AllowSuitStorageComponent : Component
|
public sealed partial class AllowSuitStorageComponent : Component
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Whitelist for what entities are allowed in the suit storage slot.
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public EntityWhitelist Whitelist = new()
|
||||||
|
{
|
||||||
|
Components = new[] {"Item"}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -248,9 +248,17 @@ public abstract partial class InventorySystem
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (slotDefinition.DependsOnComponents is { } componentRegistry)
|
if (slotDefinition.DependsOnComponents is { } componentRegistry)
|
||||||
|
{
|
||||||
foreach (var (_, entry) in componentRegistry)
|
foreach (var (_, entry) in componentRegistry)
|
||||||
|
{
|
||||||
if (!HasComp(slotEntity, entry.Component.GetType()))
|
if (!HasComp(slotEntity, entry.Component.GetType()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (TryComp<AllowSuitStorageComponent>(slotEntity, out var comp) &&
|
||||||
|
_whitelistSystem.IsWhitelistFailOrNull(comp.Whitelist, itemUid))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var fittingInPocket = slotDefinition.SlotFlags.HasFlag(SlotFlags.POCKET) &&
|
var fittingInPocket = slotDefinition.SlotFlags.HasFlag(SlotFlags.POCKET) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user