Rework how 'buyRestrictionMax' is handled, bsg send it as string or int

This commit is contained in:
Chomp 2022-02-09 23:11:21 +00:00
parent 4db87343a0
commit a300da8dba
2 changed files with 4 additions and 3 deletions

View File

@ -15,8 +15,9 @@ namespace AssortUpdater
{
if (liveAssort.RawItem.upd.StackObjectsCount == 0)
{
var newStackCount = liveAssort.RawItem.upd.BuyRestrictionMax.HasValue
? (liveAssort.RawItem.upd.BuyRestrictionMax.Value * 10)
var canBeParsed = int.TryParse(liveAssort.RawItem.upd.BuyRestrictionMax?.ToString(), out int BuyRestrictionMax);
var newStackCount = canBeParsed
? (BuyRestrictionMax * 10)
: 1000;
liveAssort.RawItem.upd.StackObjectsCount = newStackCount;
LoggingHelpers.LogWarning($"live assort: {liveAssort.ItemName} level: {liveAssort.Level} has a stack of 0, adding a new value of {newStackCount}");

View File

@ -44,7 +44,7 @@ namespace AssortValidator.Common.Models
public class Upd
{
public int? BuyRestrictionMax { get; set; }
public object BuyRestrictionMax { get; set; }
public int? BuyRestrictionCurrent { get; set; }
public int? StackObjectsCount { get; set; }
public bool? UnlimitedCount { get; set; }