Lossless v1->v2 upgrade

This commit is contained in:
Kurt 2021-11-05 14:27:40 -07:00
parent 22e7571e80
commit caab4f5512
2 changed files with 18 additions and 2 deletions

View File

@ -36,8 +36,12 @@ public Item DoorDecoItemName
public VillagerHouse2 Upgrade()
{
var data = new byte[VillagerHouse2.SIZE];
var empty = Item.NONE.ToBytes();
Data.CopyTo(data, 0);
return new VillagerHouse2(data) { DoorDecoItemName = Item.NO_ITEM };
for (int i = 0; i < 236; i++)
empty.CopyTo(data, 0x1D8 + (i * 0xC));
VillagerHouse2.Footer.CopyTo(data, 0x1270);
return new VillagerHouse2(data);
}
}
}
}

View File

@ -32,6 +32,18 @@ public VillagerHouse1 Downgrade()
Data.CopyTo(result, 0);
return new VillagerHouse1(result);
}
internal static readonly byte[] Footer =
{
0x4B, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x9B, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0xF8, 0x00, 0xF8, 0x00, 0x40,
0x10, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
}
#pragma warning disable CS8618, CA1815, CA1819, IDE1006, RCS1170