Skip to content

Commit 45f2704

Browse files
committed
Fix for Modpacks with the same file in them redundantly generating multiple modlist entries for the same file.
1 parent 6c71c62 commit 45f2704

File tree

1 file changed

+10
-0
lines changed
  • xivModdingFramework/Mods/FileTypes

1 file changed

+10
-0
lines changed

xivModdingFramework/Mods/FileTypes/TTMP.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ public string GetVersion(DirectoryInfo modPackDirectory)
403403
DirectoryInfo gameDirectory, DirectoryInfo modListDirectory, IProgress<(int current, int total, string message)> progress)
404404
{
405405
var dat = new Dat(gameDirectory);
406+
var modding = new Modding(gameDirectory);
406407
var modListFullPaths = new List<string>();
407408
var modList = JsonConvert.DeserializeObject<ModList>(File.ReadAllText(modListDirectory.FullName));
408409
var modCount = 1;
@@ -466,6 +467,15 @@ await dat.WriteToDat(new List<byte>(data), null, modJson.FullPath,
466467
modJson.Category.GetDisplayName(), modJson.Name,
467468
XivDataFiles.GetXivDataFile(modJson.DatFile), _source,
468469
GetDataType(modJson.FullPath), modJson.ModPackEntry);
470+
471+
// Add this new entry into the mod list we're testing against
472+
// so we don't redundantly add files.
473+
var modListEntry = await modding.TryGetModEntry(modJson.FullPath);
474+
if(modListEntry != null)
475+
{
476+
modListFullPaths.Add(modJson.FullPath);
477+
modList.Mods.Add(modListEntry);
478+
}
469479
}
470480
}
471481
catch (Exception ex)

0 commit comments

Comments
 (0)