diff --git a/SabreTools.DatFiles/DatFile.Removal.cs b/SabreTools.DatFiles/DatFile.Removal.cs index 568b7968..b501e146 100644 --- a/SabreTools.DatFiles/DatFile.Removal.cs +++ b/SabreTools.DatFiles/DatFile.Removal.cs @@ -151,9 +151,9 @@ namespace SabreTools.DatFiles // Get the combined list of fields to remove var fieldNames = new HashSet(); if (itemFieldNames.ContainsKey(itemType)) - fieldNames.IntersectWith(itemFieldNames[itemType]); + fieldNames.UnionWith(itemFieldNames[itemType]); if (itemFieldNames.ContainsKey("item")) - fieldNames.IntersectWith(itemFieldNames["item"]); + fieldNames.UnionWith(itemFieldNames["item"]); // If the field specifically contains Name, set it separately if (fieldNames.Contains(Models.Metadata.Rom.NameKey)) diff --git a/SabreTools.DatFiles/ItemDictionary.cs b/SabreTools.DatFiles/ItemDictionary.cs index 61c789bb..3e2244bf 100644 --- a/SabreTools.DatFiles/ItemDictionary.cs +++ b/SabreTools.DatFiles/ItemDictionary.cs @@ -1286,7 +1286,7 @@ namespace SabreTools.DatFiles if (devItems == null) continue; - newDeviceReferences.IntersectWith(devItems + newDeviceReferences.UnionWith(devItems .Where(i => i is DeviceRef) .Select(i => (i as DeviceRef)!.GetName()!)); @@ -1336,7 +1336,7 @@ namespace SabreTools.DatFiles if (slotItems == null) continue; - newSlotOptions.IntersectWith(slotItems + newSlotOptions.UnionWith(slotItems .Where(i => i is Slot) .Where(s => (s as Slot)!.SlotOptionsSpecified) .SelectMany(s => (s as Slot)!.GetFieldValue(Models.Metadata.Slot.SlotOptionKey)!) diff --git a/SabreTools.DatFiles/ItemDictionaryDB.cs b/SabreTools.DatFiles/ItemDictionaryDB.cs index 91b2b8d6..6309d104 100644 --- a/SabreTools.DatFiles/ItemDictionaryDB.cs +++ b/SabreTools.DatFiles/ItemDictionaryDB.cs @@ -1716,7 +1716,7 @@ namespace SabreTools.DatFiles continue; // Add to the list of new device reference names - newDeviceReferences.IntersectWith(devItems + newDeviceReferences.UnionWith(devItems .Where(i => i.Item2 is DeviceRef) .Select(i => (i.Item2 as DeviceRef)!.GetName()!)); @@ -1771,7 +1771,7 @@ namespace SabreTools.DatFiles continue; // Add to the list of new slot option names - newSlotOptions.IntersectWith(slotItems + newSlotOptions.UnionWith(slotItems .Where(i => i.Item2 is Slot) .Where(s => (s.Item2 as Slot)!.SlotOptionsSpecified) .SelectMany(s => (s.Item2 as Slot)!.GetFieldValue(Models.Metadata.Slot.SlotOptionKey)!) diff --git a/SabreTools.DatTools/Replacer.cs b/SabreTools.DatTools/Replacer.cs index b5561a8e..0f251ca2 100644 --- a/SabreTools.DatTools/Replacer.cs +++ b/SabreTools.DatTools/Replacer.cs @@ -64,9 +64,9 @@ namespace SabreTools.DatTools // Get the combined list of fields to remove var fieldNames = new HashSet(); if (itemFieldNames.ContainsKey(itemType)) - fieldNames.IntersectWith(itemFieldNames[itemType]); + fieldNames.UnionWith(itemFieldNames[itemType]); if (itemFieldNames.ContainsKey("item")) - fieldNames.IntersectWith(itemFieldNames["item"]); + fieldNames.UnionWith(itemFieldNames["item"]); // If the field specifically contains Name, set it separately if (fieldNames.Contains(Models.Metadata.Rom.NameKey))