Trying to save an unloaded item caused a crash

This commit is contained in:
Jewel
2022-08-03 16:26:48 +01:00
parent 3811a86c95
commit 54ce3a8c75

View File

@@ -144,7 +144,7 @@ namespace ItemChecklist
public override void SaveData(TagCompound tag)
{
// sanitize? should be possible to add item already seen.
tag["FoundItems"] = foundItems.Select(ItemIO.Save).ToList();
tag["FoundItems"] = foundItems.Where(item => item.Name != "Unloaded Item").Select(ItemIO.Save).ToList();
//tag["SortMode"] = (int)ItemChecklistUI.sortMode;
tag["Announce"] = ItemChecklistUI.announce; // Not saving default, saving last used....good thing?
tag["CollectChestItems"] = ItemChecklistUI.collectChestItems;