From 23aed12f16bab5c4d16d0ea4c567508e72efdc19 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 10 Dec 2016 08:58:19 -0800 Subject: [PATCH] Fix pouch sanitize variable datasize not max count doh Closes #621 --- PKHeX/Saves/Substructures/Inventory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKHeX/Saves/Substructures/Inventory.cs b/PKHeX/Saves/Substructures/Inventory.cs index b8f31c8a2..554879717 100644 --- a/PKHeX/Saves/Substructures/Inventory.cs +++ b/PKHeX/Saves/Substructures/Inventory.cs @@ -261,7 +261,7 @@ public void sortName(string[] names, bool reverse = false) public void sanitizePouch(bool HaX, int MaxItemID) { var x = Items.Where(item => item.Valid(LegalItems, HaX, MaxItemID)).ToArray(); - Items = x.Concat(new byte[MaxCount - x.Length].Select(i => new InventoryItem())).ToArray(); + Items = x.Concat(new byte[PouchDataSize - x.Length].Select(i => new InventoryItem())).ToArray(); } } }