mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 22:54:14 +00:00
add free space tracking
This commit is contained in:
parent
c3eec76ddc
commit
2b6fb05c77
1 changed files with 4 additions and 0 deletions
|
@ -20,6 +20,7 @@ namespace PKHeX
|
|||
public class InventoryItem
|
||||
{
|
||||
public bool New;
|
||||
public bool FreeSpace;
|
||||
public int Index, Count;
|
||||
public InventoryItem Clone()
|
||||
{
|
||||
|
@ -87,6 +88,7 @@ namespace PKHeX
|
|||
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 @@ namespace PKHeX
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue