Gen1/2: Fix party read

Oopsie false->true ez
Closes #4253
This commit is contained in:
Kurt
2024-04-24 19:24:49 -05:00
parent 9ff94455b9
commit 2296d34df3
2 changed files with 6 additions and 6 deletions

View File

@@ -95,7 +95,7 @@ private void Initialize(GameVersion versionOverride)
var ofs = Offsets.Party;
var src = Data.AsSpan(ofs, SIZE_PARTY_LIST);
var dest = PartyBuffer[GetPartyOffset(0)..];
PokeList1.Unpack(src, dest, StringLength, 6, false);
PokeList1.Unpack(src, dest, StringLength, 6, true);
}
ReadOnlySpan<byte> rawDC = Data.AsSpan(Offsets.Daycare, 0x38);
@@ -183,7 +183,7 @@ private int GetBoxRawDataOffset(int box)
protected override SAV1 CloneInternal() => new(Write(), Version) { Language = Language };
protected override int SIZE_STORED => Japanese ? PokeCrypto.SIZE_1JLIST : PokeCrypto.SIZE_1ULIST;
protected override int SIZE_PARTY => Japanese ? PokeCrypto.SIZE_1JLIST : PokeCrypto.SIZE_1ULIST;
protected override int SIZE_PARTY => SIZE_STORED;
private int SIZE_BOX_AS_SINGLES => BoxSlotCount * SIZE_STORED;
private int SIZE_BOX_LIST => (((StringLength * 2) + PokeCrypto.SIZE_1STORED + 1) * BoxSlotCount) + 2;
private int SIZE_PARTY_LIST => (((StringLength * 2) + PokeCrypto.SIZE_1PARTY + 1) * 6) + 2;

View File

@@ -99,7 +99,7 @@ private void Initialize()
var ofs = Offsets.Party;
var src = Data.AsSpan(ofs, SIZE_PARTY_LIST);
var dest = PartyBuffer[GetPartyOffset(0)..];
PokeList2.Unpack(src, dest, StringLength, 6, false);
PokeList2.Unpack(src, dest, StringLength, 6, true);
}
if (Offsets.Daycare >= 0)
@@ -229,11 +229,11 @@ protected override byte[] GetFinalData()
protected override SAV2 CloneInternal() => new(Write(), Version) { Language = Language };
protected override int SIZE_STORED => Japanese ? PokeCrypto.SIZE_2JLIST : PokeCrypto.SIZE_2ULIST;
protected override int SIZE_PARTY => Japanese ? PokeCrypto.SIZE_2JLIST : PokeCrypto.SIZE_2ULIST;
protected override int SIZE_PARTY => SIZE_STORED;
public override PK2 BlankPKM => new(jp: Japanese);
public override Type PKMType => typeof(PK2);
private int SIZE_BOX_AS_SINGLES => BoxSlotCount*SIZE_STORED;
private int SIZE_BOX_AS_SINGLES => BoxSlotCount * SIZE_STORED;
private int SIZE_BOX_LIST => (((StringLength * 2) + PokeCrypto.SIZE_2STORED + 1) * BoxSlotCount) + 2;
private int SIZE_PARTY_LIST => (((StringLength * 2) + PokeCrypto.SIZE_2PARTY + 1) * 6) + 2;
@@ -558,7 +558,7 @@ private int GetDaycareOffset(int index)
}
public int DaycareSlotCount => 2;
private int GetDaycareSlotOffset(int slot) => GetPartyOffset(7 + (slot * 2));
private int GetDaycareSlotOffset(int slot) => GetPartyOffset(6 + slot);
public Memory<byte> GetDaycareSlot(int slot) => Reserved.AsMemory(GetDaycareSlotOffset(slot), SIZE_STORED);
public Memory<byte> GetDaycareEgg() => Reserved.AsMemory(GetDaycareSlotOffset(2), SIZE_STORED);
public bool IsDaycareOccupied(int slot) => (DaycareFlagByte(slot) & 1) != 0;