Restore Slavic save lift and redress abstract underwear on load.
Recheck of slice 7 stage A found UpgradeOlderSave removed after UpperUnderwear, so format-2 nameSetId saves never started, and golden people.json wearing abstract Underwear failed RequireKnownApparel. Bring back the lift, treat unusable items as undressed, and restore GoldenSaveTests.
This commit is contained in:
@@ -130,9 +130,9 @@ public class DressGeneratorTests
|
||||
roster.Families,
|
||||
roster.Classes);
|
||||
|
||||
Assert.True(DressGenerator.NeedsDressing(stripped, ApplicantPool.Empty));
|
||||
Assert.True(DressGenerator.NeedsDressing(catalog, stripped, ApplicantPool.Empty));
|
||||
var dressed = DressGenerator.EnsureRoster(catalog, stripped, Fixtures.SchoolSeed, Fixtures.AsOf);
|
||||
Assert.False(DressGenerator.NeedsDressing(dressed, ApplicantPool.Empty));
|
||||
Assert.False(DressGenerator.NeedsDressing(catalog, dressed, ApplicantPool.Empty));
|
||||
Assert.Equal(ItemsSnapshot(roster), ItemsSnapshot(dressed));
|
||||
}
|
||||
|
||||
@@ -180,6 +180,34 @@ public class DressGeneratorTests
|
||||
Assert.All(roster.People, person => Assert.True(person.Skills.ContainsKey("Hauling")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AbstractUnderwearInASave_IsRedressedOnEnsure()
|
||||
{
|
||||
var catalog = Fixtures.Catalog();
|
||||
var roster = Fixtures.Generate(Fixtures.Classrooms(4));
|
||||
var broken = new Roster(
|
||||
roster.People.Select(person =>
|
||||
{
|
||||
var items = person.Items.Select(item =>
|
||||
item.Def.Equals("Briefs", StringComparison.Ordinal)
|
||||
|| item.Def.Equals("Boxers", StringComparison.Ordinal)
|
||||
|| item.Def.Equals("Panties", StringComparison.Ordinal)
|
||||
? item with { Def = "Underwear" }
|
||||
: item).ToArray();
|
||||
return person with { Items = items };
|
||||
}).ToArray(),
|
||||
roster.Families,
|
||||
roster.Classes);
|
||||
|
||||
Assert.True(DressGenerator.NeedsDressing(catalog, broken, ApplicantPool.Empty));
|
||||
var dressed = DressGenerator.EnsureRoster(catalog, broken, Fixtures.SchoolSeed, Fixtures.AsOf);
|
||||
Assert.False(DressGenerator.NeedsDressing(catalog, dressed, ApplicantPool.Empty));
|
||||
Assert.Equal(ItemsSnapshot(roster), ItemsSnapshot(dressed));
|
||||
Assert.DoesNotContain(
|
||||
dressed.People.SelectMany(person => person.Items),
|
||||
item => item.Def.Equals("Underwear", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
private static string ItemsSnapshot(Roster roster) =>
|
||||
string.Join(
|
||||
'\n',
|
||||
|
||||
Reference in New Issue
Block a user