diff --git a/Penumbra/Mods/ItemSwap/EquipmentSwap.cs b/Penumbra/Mods/ItemSwap/EquipmentSwap.cs index 51b3dea0..231ce02d 100644 --- a/Penumbra/Mods/ItemSwap/EquipmentSwap.cs +++ b/Penumbra/Mods/ItemSwap/EquipmentSwap.cs @@ -64,6 +64,12 @@ public static class EquipmentSwap var imcFileTo = new ImcFile( imcManip); var isAccessory = slot.IsAccessory(); + var estType = slot switch + { + EquipSlot.Head => EstManipulation.EstType.Head, + EquipSlot.Body => EstManipulation.EstType.Body, + _ => ( EstManipulation.EstType )0, + }; var skipFemale = false; var skipMale = false; @@ -83,6 +89,7 @@ public static class EquipmentSwap continue; } + try { var eqdp = CreateEqdp( redirections, manips, slot, gr, idFrom, idTo, mtrlVariantTo ); @@ -90,6 +97,13 @@ public static class EquipmentSwap { swaps.Add( eqdp ); } + + var ownMdl = eqdp?.SwapApplied.Eqdp.Entry.ToBits( slot ).Item2 ?? false; + var est = ItemSwap.CreateEst( redirections, manips, estType, gr, idFrom, idTo, ownMdl ); + if( est != null ) + { + swaps.Add( est ); + } } catch( ItemSwap.MissingFileException e ) { @@ -128,19 +142,6 @@ public static class EquipmentSwap { var mdl = CreateMdl( redirections, slot, gr, idFrom, idTo, mtrlTo ); meta.ChildSwaps.Add( mdl ); - - var estType = slot switch - { - EquipSlot.Head => EstManipulation.EstType.Head, - EquipSlot.Body => EstManipulation.EstType.Body, - _ => ( EstManipulation.EstType )0, - }; - - var est = ItemSwap.CreateEst( redirections, manips, estType, gr, idFrom, idTo ); - if( est != null ) - { - meta.ChildSwaps.Add( est ); - } } else if( !ownMtrl && meta.SwapAppliedIsDefault ) { diff --git a/Penumbra/Mods/ItemSwap/ItemSwap.cs b/Penumbra/Mods/ItemSwap/ItemSwap.cs index 68812674..2369a92d 100644 --- a/Penumbra/Mods/ItemSwap/ItemSwap.cs +++ b/Penumbra/Mods/ItemSwap/ItemSwap.cs @@ -159,7 +159,7 @@ public static class ItemSwap /// metaChanges is not manipulated, but IReadOnlySet does not support TryGetValue. public static MetaSwap? CreateEst( Func< Utf8GamePath, FullPath > redirections, Func< MetaManipulation, MetaManipulation > manips, EstManipulation.EstType type, - GenderRace genderRace, SetId idFrom, SetId idTo ) + GenderRace genderRace, SetId idFrom, SetId idTo, bool ownMdl ) { if( type == 0 ) { @@ -171,7 +171,7 @@ public static class ItemSwap var toDefault = new EstManipulation( gender, race, type, idTo.Value, EstFile.GetDefault( type, genderRace, idTo.Value ) ); var est = new MetaSwap( manips, fromDefault, toDefault ); - if( est.SwapApplied.Est.Entry >= 2 ) + if( ownMdl && est.SwapApplied.Est.Entry >= 2 ) { var phyb = CreatePhyb( redirections, type, genderRace, est.SwapApplied.Est.Entry ); est.ChildSwaps.Add( phyb ); diff --git a/Penumbra/Mods/ItemSwap/ItemSwapContainer.cs b/Penumbra/Mods/ItemSwap/ItemSwapContainer.cs index deb15bee..66d4851e 100644 --- a/Penumbra/Mods/ItemSwap/ItemSwapContainer.cs +++ b/Penumbra/Mods/ItemSwap/ItemSwapContainer.cs @@ -145,7 +145,7 @@ public class ItemSwapContainer }; var metaResolver = MetaResolver( collection ); - var est = ItemSwap.CreateEst( pathResolver, metaResolver, type, race, from, to ); + var est = ItemSwap.CreateEst( pathResolver, metaResolver, type, race, from, to, true ); Swaps.Add( mdl ); if( est != null )