Reset buy restriction current to 0
This commit is contained in:
parent
bee8f35955
commit
b839987cd4
@ -4,6 +4,7 @@ using AssortGenerator.Models.Input;
|
|||||||
using AssortGenerator.Models.Other;
|
using AssortGenerator.Models.Other;
|
||||||
using AssortGenerator.Models.Output;
|
using AssortGenerator.Models.Output;
|
||||||
using Common;
|
using Common;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -40,6 +41,8 @@ namespace AssortGenerator
|
|||||||
// Fix items that have ran out of stock in the dump and give stack size
|
// Fix items that have ran out of stock in the dump and give stack size
|
||||||
FixZeroSizedStackAssorts(items, 100);
|
FixZeroSizedStackAssorts(items, 100);
|
||||||
|
|
||||||
|
FixFullyPurchasedStackLimits(items);
|
||||||
|
|
||||||
// Find barter scheme node and parse into dictionary
|
// Find barter scheme node and parse into dictionary
|
||||||
var barterSchemeJson = data.GetProperty("barter_scheme").ToString();
|
var barterSchemeJson = data.GetProperty("barter_scheme").ToString();
|
||||||
var barterSchemeItems = JsonSerializer.Deserialize<Dictionary<string, object>>(barterSchemeJson);
|
var barterSchemeItems = JsonSerializer.Deserialize<Dictionary<string, object>>(barterSchemeJson);
|
||||||
@ -62,6 +65,16 @@ namespace AssortGenerator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void FixFullyPurchasedStackLimits(List<Item> 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create input/assorts/output/traders folders
|
/// Create input/assorts/output/traders folders
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user