Skip to content

Commit 357cf0e

Browse files
committed
- Fix for copying from equipment set 0
- Fix for metadata files not being included in resulting modpack.
1 parent 3b2baa7 commit 357cf0e

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

xivModdingFramework/Mods/RootCloner.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,24 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
9191
newMetadata.Root = Destination.Info.ToFullRoot();
9292
var originalDestinationMetadata = await ItemMetadata.GetMetadata(Destination);
9393

94+
// Set 0 needs special handling.
95+
if(Source.Info.PrimaryType == XivItemType.equipment && Source.Info.PrimaryId == 0)
96+
{
97+
var set1Root = new XivDependencyRoot(Source.Info.PrimaryType, 1, null, null, Source.Info.Slot);
98+
var set1Metadata = await ItemMetadata.GetMetadata(set1Root);
99+
100+
newMetadata.EqpEntry = set1Metadata.EqpEntry;
101+
102+
if (Source.Info.Slot == "met")
103+
{
104+
newMetadata.GmpEntry = set1Metadata.GmpEntry;
105+
}
106+
} else if (Destination.Info.PrimaryType == XivItemType.equipment && Destination.Info.PrimaryId == 0)
107+
{
108+
newMetadata.EqpEntry = null;
109+
newMetadata.GmpEntry = null;
110+
}
111+
94112

95113
// Now figure out the path names for all of our new paths.
96114
// These dictionarys map Old Path => New Path
@@ -143,13 +161,14 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
143161
newMaterialPaths.Select(x => x.Value)).Union(
144162
newAvfxPaths.Select(x => x.Value)).Union(
145163
newTexturePaths.Select(x => x.Value));
146-
147164
var allFiles = new HashSet<string>();
148165
foreach (var f in files)
149166
{
150167
allFiles.Add(f);
151168
}
152169

170+
allFiles.Add(Destination.Info.GetRootFile());
171+
153172
if (ProgressReporter != null)
154173
{
155174
ProgressReporter.Report("Getting modlist...");

0 commit comments

Comments
 (0)