Skip to content

Commit 2903f4e

Browse files
committed
Fix for root converting to itself resulting in deleting the mods on the item.
1 parent a812145 commit 2903f4e

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

xivModdingFramework/Mods/RootCloner.cs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,24 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
159159
ProgressReporter.Report("Removing existing modifications to destination root...");
160160
}
161161

162-
var dPath = Destination.Info.GetRootFolder();
163-
foreach (var mod in modlist.Mods)
162+
if (Destination != Source)
164163
{
165-
if (mod.fullPath.StartsWith(dPath) && !mod.IsInternal())
164+
var dPath = Destination.Info.GetRootFolder();
165+
foreach (var mod in modlist.Mods)
166166
{
167-
if (Destination.Info.SecondaryType != null || Destination.Info.Slot == null)
168-
{
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))
167+
if (mod.fullPath.StartsWith(dPath) && !mod.IsInternal())
173168
{
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);
169+
if (Destination.Info.SecondaryType != null || Destination.Info.Slot == null)
170+
{
171+
// If this is a slotless root, purge everything.
172+
await _modding.DeleteMod(mod.fullPath, false);
173+
}
174+
else if (allFiles.Contains(mod.fullPath) || mod.fullPath.Contains(Destination.Info.Slot))
175+
{
176+
// Otherwise, only purge the files we're replacing, and anything else that
177+
// contains our slot name.
178+
await _modding.DeleteMod(mod.fullPath, false);
179+
}
177180
}
178181
}
179182
}

0 commit comments

Comments
 (0)