Skip to content

Commit bbb9cdc

Browse files
committed
Update v2.3.4.14
2 parents 60bc6cd + ecf334a commit bbb9cdc

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

xivModdingFramework/Helpers/ProblemChecker.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ public Task<bool> RestoreBackups(DirectoryInfo backupsDirectory)
333333
}
334334
}
335335

336+
var _index = new Index(_gameDirectory);
336337
// Make sure backups exist and are up to date unless called with forceRestore true
337338
if (backupFiles.Length != 0 && !outdated)
338339
{
@@ -344,6 +345,9 @@ public Task<bool> RestoreBackups(DirectoryInfo backupsDirectory)
344345
File.Copy(backupFile, $"{_gameDirectory}/{Path.GetFileName(backupFile)}", true);
345346
}
346347
}
348+
349+
// Update all the index counts to be safe, in case the user's index backups were generated when some mod dats existed.
350+
_index.UpdateAllIndexDatCounts();
347351
return true;
348352
}
349353
return false;

xivModdingFramework/SqPack/FileTypes/Index.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ public Index(DirectoryInfo gameDirectory)
4747
_gameDirectory = gameDirectory;
4848
}
4949

50+
public void UpdateAllIndexDatCounts()
51+
{
52+
var dataFiles = (XivDataFile[])Enum.GetValues(typeof(XivDataFile));
53+
54+
var _dat = new Dat(XivCache.GameInfo.GameDirectory);
55+
foreach(var df in dataFiles)
56+
{
57+
var datNumber = _dat.GetLargestDatNumber(df);
58+
UpdateIndexDatCount(df, datNumber);
59+
}
60+
}
61+
5062
/// <summary>
5163
/// Update the dat count within the index files.
5264
/// </summary>

xivModdingFramework/Variants/FileTypes/Imc.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ internal async Task SaveEntries(string path, string slot, List<XivImc> entries,
243243
FullImcInfo info;
244244
if(exists)
245245
{
246-
info = await GetFullImcInfo(path);
246+
info = await GetFullImcInfo(path, cachedIndexFile, cachedModList);
247247
} else
248248
{
249249
var ri = XivDependencyGraph.ExtractRootInfo(path);

0 commit comments

Comments
 (0)