Fix depot sort

This commit is contained in:
Matt Nadareski
2020-08-11 13:33:08 -07:00
parent 98a8c9cbfd
commit d9c32fc51e

View File

@@ -1948,7 +1948,8 @@ namespace SabreTools.Library.DatFiles
Items.BucketBy(BucketedBy.SHA1, DedupeType.None);
// Then we want to loop through each of the hashes and see if we can rebuild
foreach (string hash in Items.Keys)
var keys = Items.SortedKeys.ToList();
foreach (string hash in keys)
{
// Pre-empt any issues that could arise from string length
if (hash.Length != Constants.SHA1Length)
@@ -1982,6 +1983,10 @@ namespace SabreTools.Library.DatFiles
if (fileinfo == null)
continue;
// If there are no items in the hash, we continue
if (Items[hash] == null || Items[hash].Count == 0)
continue;
// Otherwise, we rebuild that file to all locations that we need to
bool usedInternally;
if (Items[hash][0].ItemType == ItemType.Disk)