Better sort, fix naming collisions

This commit is contained in:
Matt Nadareski
2020-08-31 16:46:04 -07:00
parent e98039ae38
commit 0c10eaa52f
3 changed files with 18 additions and 10 deletions

View File

@@ -1415,7 +1415,7 @@ namespace SabreTools.Library.DatFiles
DatItem datItem = (DatItem)item.Clone();
newdevs.AddRange((datItem.Machine.DeviceReferences ?? new List<ListXmlDeviceReference>()).Select(d => d.Name).ToList());
datItem.CopyMachineInformation(copyFrom);
if (Items[game].Where(i => i.Name.ToLowerInvariant() == datItem.Name.ToLowerInvariant()).Count() == 0)
if (!Items[game].Contains(datItem))
{
foundnew = true;
Items.Add(game, datItem);
@@ -1473,7 +1473,7 @@ namespace SabreTools.Library.DatFiles
newSlotOptions.AddRange(machineSlotOptions);
datItem.CopyMachineInformation(copyFrom);
if (Items[game].Where(i => i.Name.ToLowerInvariant() == datItem.Name.ToLowerInvariant()).Count() == 0)
if (!Items[game].Contains(datItem))
{
foundnew = true;
Items.Add(game, datItem);