[DatFile] Make sure games are sanitized for SplitByLevel

This commit is contained in:
Matt Nadareski
2016-10-26 14:35:09 -07:00
parent 920e4b4c6f
commit ddc39fee0f

View File

@@ -5307,14 +5307,18 @@ namespace SabreTools.Helper.Dats
tempDat.Name = null;
}
// Otherwise, we just add the game to the output DAT
// Clean the input list and set all games to be pathless
List<DatItem> items = Files[key];
items.ForEach(item => item.Machine.Name = Path.GetFileName(item.Machine.Name));
// Now add the game to the output DAT
if (tempDat.Files.ContainsKey(key))
{
tempDat.Files[key].AddRange(Files[key]);
tempDat.Files[key].AddRange(items);
}
else
{
tempDat.Files.Add(key, Files[key]);
tempDat.Files.Add(key, items);
}
// Then set the DAT name to be the parent directory name