diff --git a/Content.Server/Stack/StackSystem.cs b/Content.Server/Stack/StackSystem.cs index f3e7cda230..402eb65bea 100644 --- a/Content.Server/Stack/StackSystem.cs +++ b/Content.Server/Stack/StackSystem.cs @@ -62,6 +62,8 @@ namespace Content.Server.Stack { // Set the split stack's count. SetCount(entity.Uid, amount, stackComp); + // Don't let people dupe unlimited stacks + stackComp.Unlimited = false; } return entity; diff --git a/Content.Shared/Stacks/SharedStackComponent.cs b/Content.Shared/Stacks/SharedStackComponent.cs index 51ace8348f..791bbb8e5c 100644 --- a/Content.Shared/Stacks/SharedStackComponent.cs +++ b/Content.Shared/Stacks/SharedStackComponent.cs @@ -15,6 +15,7 @@ namespace Content.Shared.Stacks { public sealed override string Name => "Stack"; + [ViewVariables(VVAccess.ReadWrite)] [DataField("stackType", required:true, customTypeSerializer:typeof(PrototypeIdSerializer))] public string StackTypeId { get; private set; } = string.Empty; @@ -32,7 +33,14 @@ namespace Content.Shared.Stacks /// [ViewVariables(VVAccess.ReadOnly)] [DataField("max")] - public int MaxCount { get; set; } = 30; + public int MaxCount { get; set; } = 30; + + /// + /// Set to true to not reduce the count when used. + /// + [DataField("unlimited")] + [ViewVariables(VVAccess.ReadOnly)] + public bool Unlimited { get; set; } [ViewVariables] public int AvailableSpace => MaxCount - Count; diff --git a/Content.Shared/Stacks/SharedStackSystem.cs b/Content.Shared/Stacks/SharedStackSystem.cs index 3b4ebc8dcd..6ca7a99e6d 100644 --- a/Content.Shared/Stacks/SharedStackSystem.cs +++ b/Content.Shared/Stacks/SharedStackSystem.cs @@ -73,7 +73,11 @@ namespace Content.Shared.Stacks } // We do have enough things in the stack, so remove them and change. - SetCount(uid, stack.Count - amount, stack); + if (!stack.Unlimited) + { + SetCount(uid, stack.Count - amount, stack); + } + return true; }