diff --git a/SabreTools.Library/DatFiles/Filter.cs b/SabreTools.Library/DatFiles/Filter.cs index 1e7988dc..0f0feb35 100644 --- a/SabreTools.Library/DatFiles/Filter.cs +++ b/SabreTools.Library/DatFiles/Filter.cs @@ -767,6 +767,30 @@ namespace SabreTools.Library.DatFiles { try { + // Process description to machine name + if (this.DescriptionAsName) + MachineDescriptionToName(datFile); + + // If we are using tags from the DAT, set the proper input for split type unless overridden + if (useTags && this.InternalSplit == SplitType.None) + this.InternalSplit = datFile.DatHeader.ForceMerging.AsSplitType(); + + // Run internal splitting + ProcessSplitType(datFile, this.InternalSplit); + + // We remove any blanks, if we aren't supposed to have any + if (!datFile.DatHeader.KeepEmptyGames) + { + foreach (string key in datFile.Keys) + { + List items = datFile[key]; + List newitems = items.Where(i => i.ItemType != ItemType.Blank).ToList(); + + datFile.Remove(key); + datFile.AddRange(key, newitems); + } + } + // Loop over every key in the dictionary List keys = datFile.Keys; foreach (string key in keys) @@ -820,30 +844,6 @@ namespace SabreTools.Library.DatFiles datFile.AddRange(key, newitems); } - // Process description to machine name - if (this.DescriptionAsName) - MachineDescriptionToName(datFile); - - // If we are using tags from the DAT, set the proper input for split type unless overridden - if (useTags && this.InternalSplit == SplitType.None) - this.InternalSplit = datFile.DatHeader.ForceMerging.AsSplitType(); - - // Run internal splitting - ProcessSplitType(datFile, this.InternalSplit); - - // We remove any blanks, if we aren't supposed to have any - if (!datFile.DatHeader.KeepEmptyGames) - { - foreach (string key in datFile.Keys) - { - List items = datFile[key]; - List newitems = items.Where(i => i.ItemType != ItemType.Blank).ToList(); - - datFile.Remove(key); - datFile.AddRange(key, newitems); - } - } - // If we are removing scene dates, do that now if (datFile.DatHeader.SceneDateStrip) StripSceneDatesFromItems(datFile); @@ -1879,6 +1879,7 @@ namespace SabreTools.Library.DatFiles { item.CloneOf = null; item.RomOf = null; + item.SampleOf = null; } } }