diff --git a/SabreHelper/Output.cs b/SabreHelper/Output.cs index e28fc3f2..35f4e7ee 100644 --- a/SabreHelper/Output.cs +++ b/SabreHelper/Output.cs @@ -151,21 +151,23 @@ namespace SabreTools.Helper { // Get all values in the dictionary and write out List sortable = new List(); - List keys = dict.Keys.ToList(); - foreach (string key in keys) + long count = 0; + foreach (List roms in dict.Values) { if (merge) { - sortable.Add(dict[key][0]); - dict.Remove(key); + sortable.Add(roms[0]); + count++; } else { - sortable.AddRange(dict[key]); - dict.Remove(key); + sortable.AddRange(roms); + count += roms.Count; } } + logger.Log("The total number of items added for output is " + count); + // Sort the new list RomManipulation.Sort(sortable, true); diff --git a/SabreHelper/RomManipulation.cs b/SabreHelper/RomManipulation.cs index 33924b22..8d9df00f 100644 --- a/SabreHelper/RomManipulation.cs +++ b/SabreHelper/RomManipulation.cs @@ -604,7 +604,8 @@ namespace SabreTools.Helper /// /// List of RomData objects representing the roms to be sorted /// True if files are not renamed, false otherwise - public static void Sort(List roms, bool norename) + /// True if it sorted correctly, false otherwise + public static bool Sort(List roms, bool norename) { roms.Sort(delegate (RomData x, RomData y) { @@ -622,6 +623,7 @@ namespace SabreTools.Helper } return (norename ? String.Compare(x.Game, y.Game) : x.SystemID - y.SystemID); }); + return true; } ///