From aad2839736bbfc9e94851eb052d6fa3e83bded91 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 26 Mar 2026 15:36:14 -0500 Subject: [PATCH] Fix party stat decrypt from refactor --- PKHeX.Core/PKM/PA8.cs | 2 +- PKHeX.Core/PKM/PA9.cs | 2 +- PKHeX.Core/PKM/PK5.cs | 2 +- PKHeX.Core/PKM/PK9.cs | 2 +- PKHeX.Core/PKM/Shared/G4PKM.cs | 2 +- PKHeX.Core/PKM/Shared/G6PKM.cs | 2 +- PKHeX.Core/PKM/Shared/G8PKM.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PKHeX.Core/PKM/PA8.cs b/PKHeX.Core/PKM/PA8.cs index 04d02d3fd..96292c1e8 100644 --- a/PKHeX.Core/PKM/PA8.cs +++ b/PKHeX.Core/PKM/PA8.cs @@ -36,7 +36,7 @@ public sealed class PA8 : PKM, ISanityChecksum, public PA8() : base(PokeCrypto.SIZE_8APARTY) => AffixedRibbon = Core.AffixedRibbon.None; public PA8(Memory data) : base(DecryptParty(data)) { } protected override void EncryptStored(Span stored) => PokeCrypto.Encrypt8A(stored); - protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, PID); + protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, EncryptionConstant); public override int SIZE_PARTY => PokeCrypto.SIZE_8APARTY; public override int SIZE_STORED => PokeCrypto.SIZE_8ASTORED; diff --git a/PKHeX.Core/PKM/PA9.cs b/PKHeX.Core/PKM/PA9.cs index b13bf576d..8f208fd7b 100644 --- a/PKHeX.Core/PKM/PA9.cs +++ b/PKHeX.Core/PKM/PA9.cs @@ -22,7 +22,7 @@ public sealed class PA9 : PKM, ISanityChecksum, ITechRecord, IObedienceLevel, IH public IPermitRecord Permit => PersonalInfo; public override EntityContext Context => EntityContext.Gen9a; protected override void EncryptStored(Span stored) => PokeCrypto.Encrypt8(stored); - protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, PID); + protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, EncryptionConstant); public PA9() : base(PokeCrypto.SIZE_8PARTY) => AffixedRibbon = PKHeX.Core.AffixedRibbon.None; diff --git a/PKHeX.Core/PKM/PK5.cs b/PKHeX.Core/PKM/PK5.cs index aaa0b89b1..e55169d6f 100644 --- a/PKHeX.Core/PKM/PK5.cs +++ b/PKHeX.Core/PKM/PK5.cs @@ -23,7 +23,7 @@ public sealed class PK5 : PKM, ISanityChecksum, public override EntityContext Context => EntityContext.Gen5; public override PersonalInfo5B2W2 PersonalInfo => PersonalTable.B2W2.GetFormEntry(Species, Form); protected override void EncryptStored(Span stored) => PokeCrypto.Encrypt45(stored); - protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, PID); + protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, EncryptionConstant); public PK5() : base(PokeCrypto.SIZE_5PARTY) { } public PK5(Memory data) : base(DecryptParty(data)) { } diff --git a/PKHeX.Core/PKM/PK9.cs b/PKHeX.Core/PKM/PK9.cs index 8e1f0f060..5f3fe4c75 100644 --- a/PKHeX.Core/PKM/PK9.cs +++ b/PKHeX.Core/PKM/PK9.cs @@ -45,7 +45,7 @@ private static Memory DecryptParty(Memory data) private ushort CalculateChecksum() => Checksums.Add16(Data[8..PokeCrypto.SIZE_8STORED]); protected override void EncryptStored(Span stored) => PokeCrypto.Encrypt8(stored); - protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, PID); + protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, EncryptionConstant); // Simple Generated Attributes public override byte CurrentFriendship diff --git a/PKHeX.Core/PKM/Shared/G4PKM.cs b/PKHeX.Core/PKM/Shared/G4PKM.cs index 52bb21dee..c42aad87e 100644 --- a/PKHeX.Core/PKM/Shared/G4PKM.cs +++ b/PKHeX.Core/PKM/Shared/G4PKM.cs @@ -12,7 +12,7 @@ public abstract class G4PKM : PKM, IHandlerUpdate, protected G4PKM(Memory data) : base(data) { } protected G4PKM([ConstantExpected] int size) : base(size) { } protected override void EncryptStored(Span stored) => PokeCrypto.Encrypt45(stored); - protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, PID); + protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, EncryptionConstant); // Maximums public sealed override ushort MaxMoveID => Legal.MaxMoveID_4; diff --git a/PKHeX.Core/PKM/Shared/G6PKM.cs b/PKHeX.Core/PKM/Shared/G6PKM.cs index a25959a4d..22865c0f0 100644 --- a/PKHeX.Core/PKM/Shared/G6PKM.cs +++ b/PKHeX.Core/PKM/Shared/G6PKM.cs @@ -11,7 +11,7 @@ public abstract class G6PKM : PKM, ISanityChecksum, IHandlerUpdate protected G6PKM(Memory data) : base(data) { } protected G6PKM([ConstantExpected] int size) : base(size) { } protected override void EncryptStored(Span stored) => PokeCrypto.Encrypt67(stored); - protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, PID); + protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, EncryptionConstant); // Trash Bytes public sealed override Span NicknameTrash => Data.Slice(0x40, 26); diff --git a/PKHeX.Core/PKM/Shared/G8PKM.cs b/PKHeX.Core/PKM/Shared/G8PKM.cs index 1cd61800a..58665458f 100644 --- a/PKHeX.Core/PKM/Shared/G8PKM.cs +++ b/PKHeX.Core/PKM/Shared/G8PKM.cs @@ -12,7 +12,7 @@ public abstract class G8PKM : PKM, ISanityChecksum, protected G8PKM() : base(PokeCrypto.SIZE_8PARTY) { } protected G8PKM(Memory data) : base(DecryptParty(data)) { } protected override void EncryptStored(Span stored) => PokeCrypto.Encrypt8(stored); - protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, PID); + protected override void EncryptParty(Span party) => PokeCrypto.CryptArray(party, EncryptionConstant); private static Memory DecryptParty(Memory data) {