@@ -136,6 +136,18 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
136
136
var iCat = destItem . SecondaryCategory ;
137
137
var iName = destItem . Name ;
138
138
139
+
140
+ var files = newModelPaths . Select ( x => x . Value ) . Union (
141
+ newMaterialPaths . Select ( x => x . Value ) ) . Union (
142
+ newAvfxPaths . Select ( x => x . Value ) ) . Union (
143
+ newTexturePaths . Select ( x => x . Value ) ) ;
144
+
145
+ var allFiles = new HashSet < string > ( ) ;
146
+ foreach ( var f in files )
147
+ {
148
+ allFiles . Add ( f ) ;
149
+ }
150
+
139
151
if ( ProgressReporter != null )
140
152
{
141
153
ProgressReporter . Report ( "Getting modlist..." ) ;
@@ -152,7 +164,17 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
152
164
{
153
165
if ( mod . fullPath . StartsWith ( dPath ) && ! mod . IsInternal ( ) )
154
166
{
155
- await _modding . DeleteMod ( mod . fullPath , false ) ;
167
+ if ( 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 ) )
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 ) ;
177
+ }
156
178
}
157
179
}
158
180
@@ -348,16 +370,6 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
348
370
// Here we're going to go through and edit all the modded items to be joined together in a modpack for convenience.
349
371
modlist = await _modding . GetModListAsync ( ) ;
350
372
351
- var files = newModelPaths . Select ( x => x . Value ) . Union (
352
- newMaterialPaths . Select ( x => x . Value ) ) . Union (
353
- newAvfxPaths . Select ( x => x . Value ) ) . Union (
354
- newTexturePaths . Select ( x => x . Value ) ) ;
355
-
356
- var allFiles = new HashSet < string > ( ) ;
357
- foreach ( var f in files )
358
- {
359
- allFiles . Add ( f ) ;
360
- }
361
373
362
374
363
375
var modPack = new ModPack ( ) { author = "System" , name = "Item Copy - " + srcItem . Name , url = "" , version = "1.0" } ;
0 commit comments