diff --git a/Glamourer/Designs/DesignBase64Migration.cs b/Glamourer/Designs/DesignBase64Migration.cs index d6d0886..a60c527 100644 --- a/Glamourer/Designs/DesignBase64Migration.cs +++ b/Glamourer/Designs/DesignBase64Migration.cs @@ -95,8 +95,8 @@ static void CheckSize(int length, int requiredLength) fixed (byte* ptr = bytes) { - var cur = (CharacterWeapon*)(ptr + 30); - var eq = (CharacterArmor*)(cur + 2); + var cur = (LegacyCharacterWeapon*)(ptr + 30); + var eq = (LegacyCharacterArmor*)(cur + 2); if (!humans.IsHuman(data.ModelId)) { @@ -116,7 +116,7 @@ static void CheckSize(int length, int requiredLength) } data.SetItem(slot, item); - data.SetStain(slot, mdl.Stains); + data.SetStain(slot, mdl.Stain); } var main = cur[0].Skeleton.Id == 0 @@ -129,7 +129,7 @@ static void CheckSize(int length, int requiredLength) } data.SetItem(EquipSlot.MainHand, main); - data.SetStain(EquipSlot.MainHand, cur[0].Stains); + data.SetStain(EquipSlot.MainHand, cur[0].Stain); EquipItem off; // Fist weapon hack @@ -140,7 +140,7 @@ static void CheckSize(int length, int requiredLength) if (gauntlet.Valid) { data.SetItem(EquipSlot.Hands, gauntlet); - data.SetStain(EquipSlot.Hands, cur[0].Stains); + data.SetStain(EquipSlot.Hands, cur[0].Stain); } } else @@ -157,12 +157,13 @@ static void CheckSize(int length, int requiredLength) } data.SetItem(EquipSlot.OffHand, off); - data.SetStain(EquipSlot.OffHand, cur[1].Stains); + data.SetStain(EquipSlot.OffHand, cur[1].Stain); return data; } } - public static unsafe string CreateOldBase64(in DesignData save, EquipFlag equipFlags, CustomizeFlag customizeFlags, MetaFlag meta, bool writeProtected, float alpha = 1.0f) + public static unsafe string CreateOldBase64(in DesignData save, EquipFlag equipFlags, CustomizeFlag customizeFlags, MetaFlag meta, + bool writeProtected, float alpha = 1.0f) { var data = stackalloc byte[Base64SizeV4]; data[0] = 5; @@ -185,10 +186,12 @@ public static unsafe string CreateOldBase64(in DesignData save, EquipFlag equipF | (equipFlags.HasFlag(EquipFlag.RFinger) ? 0x04 : 0) | (equipFlags.HasFlag(EquipFlag.LFinger) ? 0x08 : 0)); save.Customize.Write(data + 4); - ((CharacterWeapon*)(data + 30))[0] = save.Item(EquipSlot.MainHand).Weapon(save.Stain(EquipSlot.MainHand)); - ((CharacterWeapon*)(data + 30))[1] = save.Item(EquipSlot.OffHand).Weapon(save.Stain(EquipSlot.OffHand)); + ((LegacyCharacterWeapon*)(data + 30))[0] = + new LegacyCharacterWeapon(save.Item(EquipSlot.MainHand).Weapon(save.Stain(EquipSlot.MainHand))); + ((LegacyCharacterWeapon*)(data + 30))[1] = + new LegacyCharacterWeapon(save.Item(EquipSlot.OffHand).Weapon(save.Stain(EquipSlot.OffHand))); foreach (var slot in EquipSlotExtensions.EqdpSlots) - ((CharacterArmor*)(data + 44))[slot.ToIndex()] = save.Item(slot).Armor(save.Stain(slot)); + ((LegacyCharacterArmor*)(data + 44))[slot.ToIndex()] = new LegacyCharacterArmor(save.Item(slot).Armor(save.Stain(slot))); *(ushort*)(data + 84) = 1; // IsSet. *(float*)(data + 86) = 1f; data[90] = (byte)((save.IsHatVisible() ? 0x00 : 0x01) diff --git a/Glamourer/Interop/CharaFile/CmaFile.cs b/Glamourer/Interop/CharaFile/CmaFile.cs index da3fb43..2e06588 100644 --- a/Glamourer/Interop/CharaFile/CmaFile.cs +++ b/Glamourer/Interop/CharaFile/CmaFile.cs @@ -58,10 +58,10 @@ private static unsafe void ParseEquipment(ItemManager items, JObject jObj, ref D if (idx * 4 + 3 >= byteData.Length) continue; - var armor = ((CharacterArmor*)ptr)[idx]; + var armor = ((LegacyCharacterArmor*)ptr)[idx]; var item = items.Identify(slot, armor.Set, armor.Variant); data.SetItem(slot, item); - data.SetStain(slot, armor.Stains); + data.SetStain(slot, armor.Stain); } data.Customize.Read(ptr); diff --git a/Penumbra.GameData b/Penumbra.GameData index 45f2c90..c25ea7b 160000 --- a/Penumbra.GameData +++ b/Penumbra.GameData @@ -1 +1 @@ -Subproject commit 45f2c901b3a0131eaee18b3520184baeb0d1049d +Subproject commit c25ea7b19a6db37dd36e12b9a7a71f72a192ab57