Allow importing old (x40) building list (not x46)

This commit is contained in:
Kurt 2020-04-20 09:08:45 -07:00
parent 345f3c3f1b
commit f0492f1dc1

View File

@ -149,8 +149,9 @@ private void B_ImportAll_Click(object sender, EventArgs e)
var path = ofd.FileName;
var fi = new FileInfo(path);
const int expect = MainSaveOffsets.BuildingCount * Building.SIZE;
if (fi.Length != expect)
const int expect = Building.SIZE * MainSaveOffsets.BuildingCount; // 46
const int oldSize = Building.SIZE * 40;
if (fi.Length != expect && fi.Length != oldSize)
{
WinFormsUtil.Error($"Expected size (0x{expect:X}) != Input size (0x{fi.Length:X})", path);
return;