Ensured BuyRestrictionMax is an integer

This commit is contained in:
Chomp 2025-01-06 12:37:33 +00:00
parent b7bd6bea9b
commit 2546f6f00c

View File

@ -54,6 +54,11 @@ namespace AssortGenerator
var barterSchemeJson = dataObject.GetProperty("barter_scheme").ToString();
var barterSchemeItems = JsonSerializer.Deserialize<Dictionary<string, List<List<BarterObject>>>>(barterSchemeJson);
foreach (var item in items.Where(item => item.upd?.BuyRestrictionMax is not null))
{
item.upd.BuyRestrictionMax = int.Parse(item.upd.BuyRestrictionMax.ToString());
}
// Find loyalty level node and parse into dictionary
var loyaltyLevelItemsJson = dataObject.GetProperty("loyal_level_items").ToString();
var loyaltyLevelItems = JsonSerializer.Deserialize<Dictionary<string, int>>(loyaltyLevelItemsJson);