fix(loot): Keep # 0 and salvage combine off survive a save

LootJsonContext writes with WhenWritingDefault, so LootRule.KeepCount = 0 and
SalvageCombineSettings.Enabled = false were left out of the profile and loaded back
as the initializers' 1 / true. Always write both (JsonIgnore Never, as
LootRule.Enabled already is). The Keep # 0 host test is no longer a known failure;
new salvage-combine-off round trip.
This commit is contained in:
BlankenshipG 2026-10-08 22:51:01 -04:00
commit de981aeb3e
4 changed files with 41 additions and 3 deletions

View file

@ -95,6 +95,8 @@ public sealed class LootRule : System.ComponentModel.INotifyPropertyChanged
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)]
public bool Enabled { get; set; } = true;
public LootAction Action { get; set; } = LootAction.Keep;
// Always written: the context skips default values, and a skipped "Keep # 0" would load back as 1.
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)]
public int KeepCount { get; set; } = 1;
public List<LootCondition> Conditions { get; set; } = new();

View file

@ -12,6 +12,8 @@ namespace RynthCore.Loot;
/// </summary>
public sealed class SalvageCombineSettings
{
// Always written: LootJsonContext skips default values, and a skipped false would load back as true.
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)]
public bool Enabled { get; set; } = true;
/// <summary>Default bands applied to materials with no per-material override.</summary>