From 5ac7299fbe58be57ebf5a19383c9cc0f6d279909 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 8 Jan 2023 15:20:13 +0000 Subject: [PATCH] When stack size is 0 and buyRestrictionMax is > default stack size, use that value instead --- AssortGenerator/Program.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/AssortGenerator/Program.cs b/AssortGenerator/Program.cs index 87f2980..9089a79 100644 --- a/AssortGenerator/Program.cs +++ b/AssortGenerator/Program.cs @@ -61,7 +61,19 @@ namespace AssortGenerator .Where(item => item.upd?.StackObjectsCount == 0 && item.slotId == "hideout")) { LoggingHelpers.LogError($"item {item._tpl} found with stack count of 0, changing to {defaultStackSize}"); - item.upd.StackObjectsCount = defaultStackSize; + + if (item.upd?.BuyRestrictionMax != null) + { + var parsedRestrictionMax = int.Parse(item.upd?.BuyRestrictionMax.ToString()); + if (parsedRestrictionMax > defaultStackSize) + { + item.upd.StackObjectsCount = parsedRestrictionMax; + } + } + else + { + item.upd.StackObjectsCount = defaultStackSize; + } } }