[DatFile] Fix non-merged set creation

This commit is contained in:
Matt Nadareski
2017-01-09 12:34:35 -08:00
parent 9b7e486749
commit c9b9912b8c

View File

@@ -513,9 +513,15 @@ namespace SabreTools.Helper.Dats
continue; continue;
} }
// If the parent doesn't exist, then we continue // If the parent doesn't exist, then we continue and remove
if (this[parent].Count == 0) if (this[parent].Count == 0)
{ {
List<DatItem> curitems = this[game];
foreach (DatItem item in curitems)
{
item.Machine.CloneOf = null;
item.Machine.RomOf = null;
}
continue; continue;
} }
@@ -530,32 +536,32 @@ namespace SabreTools.Helper.Dats
case ItemType.Archive: case ItemType.Archive:
Archive archive = (Archive)item; Archive archive = (Archive)item;
archive.Machine = currentMachine; archive.Machine = currentMachine;
this[parent].Add(archive); this[game].Add(archive);
break; break;
case ItemType.BiosSet: case ItemType.BiosSet:
BiosSet biosSet = (BiosSet)item; BiosSet biosSet = (BiosSet)item;
biosSet.Machine = currentMachine; biosSet.Machine = currentMachine;
this[parent].Add(biosSet); this[game].Add(biosSet);
break; break;
case ItemType.Disk: case ItemType.Disk:
Disk disk = (Disk)item; Disk disk = (Disk)item;
disk.Machine = currentMachine; disk.Machine = currentMachine;
this[parent].Add(disk); this[game].Add(disk);
break; break;
case ItemType.Release: case ItemType.Release:
Release release = (Release)item; Release release = (Release)item;
release.Machine = currentMachine; release.Machine = currentMachine;
this[parent].Add(release); this[game].Add(release);
break; break;
case ItemType.Rom: case ItemType.Rom:
Rom rom = (Rom)item; Rom rom = (Rom)item;
rom.Machine = currentMachine; rom.Machine = currentMachine;
this[parent].Add(rom); this[game].Add(rom);
break; break;
case ItemType.Sample: case ItemType.Sample:
Sample sample = (Sample)item; Sample sample = (Sample)item;
sample.Machine = currentMachine; sample.Machine = currentMachine;
this[parent].Add(sample); this[game].Add(sample);
break; break;
} }
} }