Fix bug with deleting mods

This commit is contained in:
Ottermandias 2023-04-29 12:26:07 +02:00
parent 31338e43d6
commit 2402d0aa6f

View file

@ -116,9 +116,9 @@ public sealed class ModManager : ModStorage
}
_communicator.ModPathChanged.Invoke(ModPathChangeType.Deleted, mod, mod.ModPath, null);
Mods.RemoveAt(mod.Index);
foreach (var remainingMod in this.Skip(mod.Index))
foreach (var remainingMod in Mods.Skip(mod.Index))
--remainingMod.Index;
Mods.RemoveAt(mod.Index);
Penumbra.Log.Debug($"Deleted mod {mod.Name}.");
}