Convert ItemSize to prototypes (#21481)
* item sizes are prototypes * eek
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Toilet;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Storage.Components
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace Content.Server.Storage.Components
|
||||
/// Max item size that can be fitted into secret stash.
|
||||
/// </summary>
|
||||
[DataField("maxItemSize")]
|
||||
public ItemSize MaxItemSize = ItemSize.Small;
|
||||
public ProtoId<ItemSizePrototype> MaxItemSize = "Small";
|
||||
|
||||
/// <summary>
|
||||
/// IC secret stash name. For example "the toilet cistern".
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly SharedItemSystem _item = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -66,7 +67,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
}
|
||||
|
||||
// check if item is too big to fit into secret stash
|
||||
if (item.Size > component.MaxItemSize)
|
||||
if (_item.GetSizePrototype(item.Size) > _item.GetSizePrototype(component.MaxItemSize))
|
||||
{
|
||||
var msg = Loc.GetString("comp-secret-stash-action-hide-item-too-big",
|
||||
("item", itemToHideUid), ("stash", GetSecretPartName(uid, component)));
|
||||
|
||||
Reference in New Issue
Block a user