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; + } } }