From 4002b0a41ce4fbbffa3c0e2c2b290f2e6dd61f6d Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 19 Mar 2025 13:45:59 +0300 Subject: [PATCH] Update CP14SellWhitelistService.cs --- .../Prototype/SellServices/CP14SellWhitelistService.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Content.Shared/_CP14/Cargo/Prototype/SellServices/CP14SellWhitelistService.cs b/Content.Shared/_CP14/Cargo/Prototype/SellServices/CP14SellWhitelistService.cs index 38c68aa823..1ee8ddffd0 100644 --- a/Content.Shared/_CP14/Cargo/Prototype/SellServices/CP14SellWhitelistService.cs +++ b/Content.Shared/_CP14/Cargo/Prototype/SellServices/CP14SellWhitelistService.cs @@ -1,3 +1,4 @@ +using Content.Shared.Stacks; using Content.Shared.Whitelist; using Robust.Shared.Prototypes; using Robust.Shared.Utility; @@ -36,8 +37,13 @@ public sealed partial class CP14SellWhitelistService : CP14StoreSellService if (!whitelistSystem.IsValid(Whitelist, ent)) continue; + var count = 1; + + if (entManager.TryGetComponent(ent, out var stack)) + count = stack.Count; + suitable.Add(ent); - needCount -= 1; + needCount -= count; } if (needCount > 0)