Skip to content

Commit ce3a862

Browse files
committed
Bugfix - File Delete Errors
1 parent 1780b2f commit ce3a862

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

xivModdingFramework/Mods/Modding.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,16 @@ where mod.fullPath.Equals(modItemPath)
370370
if (modToRemove.source == "FilesAddedByTexTools")
371371
{
372372
var index = new Index(_gameDirectory);
373-
index.DeleteFileDescriptor(modItemPath, XivDataFiles.GetXivDataFile(modToRemove.datFile));
373+
var success = index.DeleteFileDescriptor(modItemPath, XivDataFiles.GetXivDataFile(modToRemove.datFile));
374+
if(!success)
375+
{
376+
throw new Exception("Failed to delete file descriptor.");
377+
}
374378
index.DeleteFileDescriptor($"{modItemPath}.flag", XivDataFiles.GetXivDataFile(modToRemove.datFile));
379+
if (!success)
380+
{
381+
throw new Exception("Failed to delete file descriptor.");
382+
}
375383
}
376384
if (modToRemove.enabled)
377385
{

xivModdingFramework/SqPack/FileTypes/Index.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ public bool DeleteFileDescriptor(string fullPath, XivDataFile dataFile)
786786
foundFolder = true;
787787
} else
788788
{
789+
foundFolder = true;
789790
Array.Copy(BitConverter.GetBytes(iFolderSize - 16), 0, modifiedIndex, position + 8, 4);
790791
}
791792
}

0 commit comments

Comments
 (0)