Skip to content

Commit 5e3eac7

Browse files
committed
Update 2.3.1.3
2 parents a812145 + c4844f6 commit 5e3eac7

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

xivModdingFramework/Mods/RootCloner.cs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
7474
foreach (var avfx in avfxSets)
7575
{
7676
var avfxStuff = await ATex.GetVfxPath(Source.Info, avfx);
77+
if (String.IsNullOrEmpty(avfxStuff.Folder) || String.IsNullOrEmpty(avfxStuff.File)) continue;
78+
7779
var path = avfxStuff.Folder + "/" + avfxStuff.File;
7880
if (await _index.FileExists(path))
7981
{
@@ -159,21 +161,24 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
159161
ProgressReporter.Report("Removing existing modifications to destination root...");
160162
}
161163

162-
var dPath = Destination.Info.GetRootFolder();
163-
foreach (var mod in modlist.Mods)
164+
if (Destination != Source)
164165
{
165-
if (mod.fullPath.StartsWith(dPath) && !mod.IsInternal())
166+
var dPath = Destination.Info.GetRootFolder();
167+
foreach (var mod in modlist.Mods)
166168
{
167-
if (Destination.Info.SecondaryType != null || Destination.Info.Slot == null)
169+
if (mod.fullPath.StartsWith(dPath) && !mod.IsInternal())
168170
{
169-
// If this is a slotless root, purge everything.
170-
await _modding.DeleteMod(mod.fullPath, false);
171-
}
172-
else if(allFiles.Contains(mod.fullPath) || mod.fullPath.Contains(Destination.Info.Slot))
173-
{
174-
// Otherwise, only purge the files we're replacing, and anything else that
175-
// contains our slot name.
176-
await _modding.DeleteMod(mod.fullPath, false);
171+
if (Destination.Info.SecondaryType != null || Destination.Info.Slot == null)
172+
{
173+
// If this is a slotless root, purge everything.
174+
await _modding.DeleteMod(mod.fullPath, false);
175+
}
176+
else if (allFiles.Contains(mod.fullPath) || mod.fullPath.Contains(Destination.Info.Slot))
177+
{
178+
// Otherwise, only purge the files we're replacing, and anything else that
179+
// contains our slot name.
180+
await _modding.DeleteMod(mod.fullPath, false);
181+
}
177182
}
178183
}
179184
}
@@ -190,6 +195,10 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
190195
var dst = kv.Value;
191196
var xmdl = await _mdl.GetRawMdlData(src);
192197
var tmdl = TTModel.FromRaw(xmdl);
198+
199+
if (xmdl == null || tmdl == null)
200+
continue;
201+
193202
tmdl.Source = dst;
194203
xmdl.MdlPath = dst;
195204

xivModdingFramework/SqPack/FileTypes/Dat.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,11 @@ public async Task<long> CopyFile(string sourcePath, string targetPath, string ca
14501450
{
14511451
var _index = new Index(_gameDirectory);
14521452
var offset = await _index.GetDataOffset(sourcePath);
1453+
if(offset == 0)
1454+
{
1455+
return 0;
1456+
}
1457+
14531458
var dataFile = IOUtil.GetDataFileFromPath(sourcePath);
14541459
return await CopyFile(offset, dataFile, targetPath, category, itemName, source, overwrite);
14551460
}

0 commit comments

Comments
 (0)