From 2b6fb05c774234430a5af16fd1b92e8dbf9c748f Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 29 Nov 2016 22:22:01 -0800 Subject: [PATCH] add free space tracking --- PKHeX/Saves/Substructures/Inventory.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PKHeX/Saves/Substructures/Inventory.cs b/PKHeX/Saves/Substructures/Inventory.cs index eca293535..7bfd3e336 100644 --- a/PKHeX/Saves/Substructures/Inventory.cs +++ b/PKHeX/Saves/Substructures/Inventory.cs @@ -20,6 +20,7 @@ public enum InventoryType public class InventoryItem { public bool New; + public bool FreeSpace; public int Index, Count; public InventoryItem Clone() { @@ -87,6 +88,7 @@ public void getPouch7(ref byte[] Data) Index = (int)(val & 0x3FF), Count = (int)(val >> 10 & 0x3FF), New = (val & 0x40000000) == 1, // 30th bit is "NEW" + FreeSpace = (val & 0x100000) == 1, // 22th bit is "FREE SPACE" }; } Items = items; @@ -106,6 +108,8 @@ public void setPouch7(ref byte[] Data) Items[i].New |= OriginalItems.All(z => z.Index != Items[i].Index); if (Items[i].New) val |= 0x40000000; + if (Items[i].FreeSpace) + val |= 0x100000; BitConverter.GetBytes(val).CopyTo(Data, Offset + i * 4); } }