From ddc39fee0f4f51cc28681b717c5b6614ef597f6c Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 26 Oct 2016 14:35:09 -0700 Subject: [PATCH] [DatFile] Make sure games are sanitized for SplitByLevel --- SabreTools.Helper/Dats/DatFile.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SabreTools.Helper/Dats/DatFile.cs b/SabreTools.Helper/Dats/DatFile.cs index 0da8d5e7..036e91cf 100644 --- a/SabreTools.Helper/Dats/DatFile.cs +++ b/SabreTools.Helper/Dats/DatFile.cs @@ -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 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