Resolve Villager Import Bug (#403)

* Add missing not operator

* Fix backwards conversions
This commit is contained in:
Charlie U 2020-09-30 11:12:48 -04:00 committed by GitHub
parent 0f79457d4c
commit f4bbb7a7bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -24,8 +24,8 @@ public static byte[] GetCompatible(byte[] data, int expect)
return expect switch
{
Villager1.SIZE when data.Length == Villager2.SIZE => Convert12(data),
Villager2.SIZE when data.Length == Villager1.SIZE => Convert21(data),
Villager1.SIZE when data.Length == Villager2.SIZE => Convert21(data),
Villager2.SIZE when data.Length == Villager1.SIZE => Convert12(data),
_ => data
};
}

View File

@ -132,7 +132,7 @@ private void B_LoadVillager_Click(object sender, EventArgs e)
var path = ofd.FileName;
var expectLength = SAV.Offsets.VillagerSize;
var fi = new FileInfo(path);
if (VillagerConverter.IsCompatible((int)fi.Length, expectLength))
if (!VillagerConverter.IsCompatible((int)fi.Length, expectLength))
{
WinFormsUtil.Error(string.Format(MessageStrings.MsgDataSizeMismatchImport, fi.Length, expectLength), path);
return;