mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 06:34:19 +00:00
GB: Don't read ghost slots
Read count from list, instead of using the full capacity. Malformed lists (truncated via count) with ghost slots should have those ghost slots ignored.
This commit is contained in:
parent
215f892f11
commit
bbfec1fb29
2 changed files with 4 additions and 2 deletions
|
@ -173,7 +173,8 @@ public static class PokeList1
|
|||
var ofsStr1 = ofsBody + (capacity * lengthBody);
|
||||
var ofsStr2 = ofsStr1 + (capacity * stringLength);
|
||||
|
||||
for (int i = 0; i < capacity; i++)
|
||||
var count = Math.Min(capacity, input[0]);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var species = input[1 + i];
|
||||
var body = input.Slice(ofsBody, lengthBody);
|
||||
|
|
|
@ -177,7 +177,8 @@ public static class PokeList2
|
|||
var ofsStr1 = ofsBody + (capacity * lengthBody);
|
||||
var ofsStr2 = ofsStr1 + (capacity * stringLength);
|
||||
|
||||
for (int i = 0; i < capacity; i++)
|
||||
var count = Math.Min(capacity, input[0]);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var species = input[1 + i];
|
||||
var body = input.Slice(ofsBody, lengthBody);
|
||||
|
|
Loading…
Reference in a new issue