Write RemoveItemsFromRomOfChild tests, fix issues

This commit is contained in:
Matt Nadareski
2025-01-13 15:28:30 -05:00
parent ce05765d06
commit 5e1066d3da
2 changed files with 104 additions and 5 deletions

View File

@@ -1101,10 +1101,10 @@ namespace SabreTools.DatFiles
// If the parent exists and has items, we remove the items that are in the parent from the current game
foreach (DatItem item in parentItems)
{
DatItem datItem = (DatItem)item.Clone();
while (items.Contains(datItem))
var matchedItems = items.FindAll(i => i.Equals(item));
foreach (var match in matchedItems)
{
Items.Remove(bucket, datItem);
Items.Remove(bucket, match);
}
}
}
@@ -1147,7 +1147,7 @@ namespace SabreTools.DatFiles
// If the parent exists and has items, we remove the items that are in the parent from the current game
foreach (var item in parentItems)
{
var matchedItems = items.Where(i => i.Value == item.Value);
var matchedItems = items.Where(i => i.Value.Equals(item.Value));
foreach (var match in matchedItems)
{
ItemsDB.RemoveItem(match.Key);