Skip to content

Commit 360eb01

Browse files
committed
Update 2.3.1.4
2 parents 5e3eac7 + ddc7ff0 commit 360eb01

File tree

3 files changed

+53
-9
lines changed

3 files changed

+53
-9
lines changed

xivModdingFramework/Cache/XivDependencyGraph.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,10 @@ private static async Task<List<XivDependencyRoot>> GetModdedRoots(string interna
14361436
/// <returns></returns>
14371437
public static XivDependencyRootInfo ExtractRootInfoFilenameOnly(string filenameWithoutExtension)
14381438
{
1439+
if(String.IsNullOrEmpty(filenameWithoutExtension))
1440+
{
1441+
return new XivDependencyRootInfo();
1442+
}
14391443
var regex = new Regex("([a-z])([0-9]{4})([a-z])([0-9]{4})");
14401444
var match = regex.Match(filenameWithoutExtension);
14411445
if(!match.Success)

xivModdingFramework/Models/FileTypes/Sklb.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public static async Task<string> GetExtraSkeletonFile(string fullMdlPath)
105105
var race = XivRaces.GetXivRace(fullMdlPath.Substring(1, 4));
106106

107107
return await GetExtraSkeletonFile(root.Info, race);
108+
108109
}
109110

110111

@@ -137,7 +138,18 @@ public static async Task<string> GetExtraSkeletonFile(XivDependencyRootInfo root
137138
{
138139
return parsedFile;
139140
}
140-
await ExtractAndParseSkel(file);
141+
142+
try
143+
{
144+
// In some cases, the extra skeleton doesn't actually exist, despite the
145+
// game files saying it should. In these cases, SE actually intends to
146+
// default to the base skel.
147+
await ExtractAndParseSkel(file);
148+
}
149+
catch
150+
{
151+
return null;
152+
}
141153
return parsedFile;
142154
}
143155

xivModdingFramework/Mods/RootCloner.cs

Lines changed: 36 additions & 8 deletions
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...");
@@ -386,11 +405,11 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
386405
{
387406
if (allFiles.Contains(mod.fullPath))
388407
{
389-
// Don't claim common path items into our modpack.
390-
if (!mod.fullPath.StartsWith(CommonPath))
391-
{
392-
mod.modPack = modPack;
393-
}
408+
// Ensure all of our modified files are attributed correctly.
409+
mod.name = iName;
410+
mod.category = iCat;
411+
mod.source = ApplicationSource;
412+
mod.modPack = modPack;
394413
}
395414
}
396415

@@ -414,9 +433,16 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
414433

415434
private static string UpdatePath(XivDependencyRoot Source, XivDependencyRoot Destination, string path)
416435
{
417-
// Things that live in the common folder get to stay there/don't get copied.
418-
if (path.StartsWith(CommonPath)) return path;
436+
// For common path items, copy them to our own personal mimic of the path.
437+
if (path.StartsWith(CommonPath))
438+
{
439+
var len = CommonPath.Length;
440+
var afterCommon = path.Substring(len);
441+
path = Destination.Info.GetRootFolder() + "common/" + afterCommon;
442+
return path;
443+
}
419444

445+
// Things that live in the common folder get to stay there/don't get copied.
420446

421447
var file = UpdateFileName(Source, Destination, path);
422448
var folder = UpdateFolder(Source, Destination, path);
@@ -426,6 +452,8 @@ private static string UpdatePath(XivDependencyRoot Source, XivDependencyRoot Des
426452

427453
private static string UpdateFolder(XivDependencyRoot Source, XivDependencyRoot Destination, string path)
428454
{
455+
456+
429457
// So first off, just copy anything from the old root folder to the new one.
430458
var match = RemoveRootPathRegex.Match(path);
431459
if(match.Success)

0 commit comments

Comments
 (0)