From b839987cd4a7e369aa4426f627883a3a3aa7a149 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 8 Jan 2023 15:06:37 +0000 Subject: [PATCH] Reset buy restriction current to 0 --- AssortGenerator/Program.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/AssortGenerator/Program.cs b/AssortGenerator/Program.cs index 98661a5..87f2980 100644 --- a/AssortGenerator/Program.cs +++ b/AssortGenerator/Program.cs @@ -4,6 +4,7 @@ using AssortGenerator.Models.Input; using AssortGenerator.Models.Other; using AssortGenerator.Models.Output; using Common; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -40,6 +41,8 @@ namespace AssortGenerator // Fix items that have ran out of stock in the dump and give stack size FixZeroSizedStackAssorts(items, 100); + FixFullyPurchasedStackLimits(items); + // Find barter scheme node and parse into dictionary var barterSchemeJson = data.GetProperty("barter_scheme").ToString(); var barterSchemeItems = JsonSerializer.Deserialize>(barterSchemeJson); @@ -62,6 +65,16 @@ namespace AssortGenerator } } + private static void FixFullyPurchasedStackLimits(List items) + { + foreach (var item in items + .Where(item => item.upd?.BuyRestrictionCurrent > 0 && item.slotId == "hideout")) + { + LoggingHelpers.LogError($"item {item._tpl} found with stack count > 0, changing to 0"); + item.upd.BuyRestrictionCurrent = 0; + } + } + /// /// Create input/assorts/output/traders folders ///