From 70b5c33e011cb44bdb307cc30ea25305c9128805 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 3 Feb 2024 09:59:54 +0000 Subject: [PATCH] Set assorts `StackObjectsCount` value wih a `UnlimitedCount` true value to 9999999 --- AssortGenerator/Program.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/AssortGenerator/Program.cs b/AssortGenerator/Program.cs index 21bb85c..ebc55d8 100644 --- a/AssortGenerator/Program.cs +++ b/AssortGenerator/Program.cs @@ -44,6 +44,8 @@ namespace AssortGenerator // Fix items that have ran out of stock in the dump and give stack size FixZeroSizedStackAssorts(items, 100); + UpdateunlimitedCountItemStackSize(items); + FixFullyPurchasedStackLimits(items); // Find barter scheme node and parse into dictionary @@ -60,12 +62,26 @@ namespace AssortGenerator JsonWriter.WriteJson(finalisedQuestData, "", Directory.GetCurrentDirectory(), "quests"); } + private static void UpdateunlimitedCountItemStackSize(List items) + { + foreach (var item in items + .Where(item => (item.upd?.UnlimitedCount.GetValueOrDefault(false) ?? false) && item.slotId == "hideout")) + { + item.upd.StackObjectsCount = 9999999; + } + } + private static void FixZeroSizedStackAssorts(List items, int defaultStackSize) { foreach (var item in items .Where(item => item.upd?.StackObjectsCount == 0 && item.slotId == "hideout")) { LoggingHelpers.LogError($"item {item._tpl} found with stack count of 0, changing to {defaultStackSize}"); + if ((bool)(item.upd?.UnlimitedCount.GetValueOrDefault(false))) + { + // Handled elsewhere + continue; + } if (item.upd?.BuyRestrictionMax != null) {