When stack size is 0 and buyRestrictionMax is > default stack size, use that value instead

This commit is contained in:
Chomp 2023-01-08 15:20:13 +00:00
parent b839987cd4
commit 5ac7299fbe

View File

@ -61,9 +61,21 @@ 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}");
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;
}
}
}
private static void FixFullyPurchasedStackLimits(List<Item> items)
{