Rework how 'buyRestrictionMax' is handled, bsg send it as string or int
This commit is contained in:
parent
4db87343a0
commit
a300da8dba
@ -15,8 +15,9 @@ namespace AssortUpdater
|
|||||||
{
|
{
|
||||||
if (liveAssort.RawItem.upd.StackObjectsCount == 0)
|
if (liveAssort.RawItem.upd.StackObjectsCount == 0)
|
||||||
{
|
{
|
||||||
var newStackCount = liveAssort.RawItem.upd.BuyRestrictionMax.HasValue
|
var canBeParsed = int.TryParse(liveAssort.RawItem.upd.BuyRestrictionMax?.ToString(), out int BuyRestrictionMax);
|
||||||
? (liveAssort.RawItem.upd.BuyRestrictionMax.Value * 10)
|
var newStackCount = canBeParsed
|
||||||
|
? (BuyRestrictionMax * 10)
|
||||||
: 1000;
|
: 1000;
|
||||||
liveAssort.RawItem.upd.StackObjectsCount = newStackCount;
|
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}");
|
LoggingHelpers.LogWarning($"live assort: {liveAssort.ItemName} level: {liveAssort.Level} has a stack of 0, adding a new value of {newStackCount}");
|
||||||
|
@ -44,7 +44,7 @@ namespace AssortValidator.Common.Models
|
|||||||
|
|
||||||
public class Upd
|
public class Upd
|
||||||
{
|
{
|
||||||
public int? BuyRestrictionMax { get; set; }
|
public object BuyRestrictionMax { get; set; }
|
||||||
public int? BuyRestrictionCurrent { get; set; }
|
public int? BuyRestrictionCurrent { get; set; }
|
||||||
public int? StackObjectsCount { get; set; }
|
public int? StackObjectsCount { get; set; }
|
||||||
public bool? UnlimitedCount { get; set; }
|
public bool? UnlimitedCount { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user