diff --git a/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterFixed9.cs b/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterFixed9.cs index cf4549f67..a2400e876 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterFixed9.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterFixed9.cs @@ -1,5 +1,5 @@ using System; -using System.Buffers.Binary; +using static System.Buffers.Binary.BinaryPrimitives; namespace PKHeX.Core; @@ -15,6 +15,7 @@ public sealed record EncounterFixed9 : EncounterStatic, IGemType private byte Location0 { get; init; } private byte Location1 { get; init; } private byte Location2 { get; init; } + private byte Location3 { get; init; } private const int MinScaleStrongTera = 200; // [200,255] @@ -32,7 +33,7 @@ public static EncounterFixed9[] GetArray(ReadOnlySpan data) private static EncounterFixed9 ReadEncounter(ReadOnlySpan data) => new() { - Species = BinaryPrimitives.ReadUInt16LittleEndian(data), + Species = ReadUInt16LittleEndian(data), Form = data[0x02], Level = data[0x03], FlawlessIVCount = data[0x04], @@ -40,14 +41,14 @@ private static EncounterFixed9 ReadEncounter(ReadOnlySpan data) => new() Gender = (sbyte)data[0x06], // 1 byte reserved Moves = new Moveset( - BinaryPrimitives.ReadUInt16LittleEndian(data[0x08..]), - BinaryPrimitives.ReadUInt16LittleEndian(data[0x0A..]), - BinaryPrimitives.ReadUInt16LittleEndian(data[0x0C..]), - BinaryPrimitives.ReadUInt16LittleEndian(data[0x0E..])), + ReadUInt16LittleEndian(data[0x08..]), + ReadUInt16LittleEndian(data[0x0A..]), + ReadUInt16LittleEndian(data[0x0C..]), + ReadUInt16LittleEndian(data[0x0E..])), Location0 = data[0x10], Location1 = data[0x11], Location2 = data[0x12], - // 1 byte reserved + Location3 = data[0x13], }; protected override bool IsMatchLocation(PKM pk) @@ -55,7 +56,7 @@ protected override bool IsMatchLocation(PKM pk) if (!pk.HasOriginalMetLocation) return true; var loc = pk.Met_Location; - return loc == Location0 || loc == Location1 || loc == Location2; + return loc == Location0 || loc == Location1 || loc == Location2 || loc == Location3; } protected override bool IsMatchForm(PKM pk, EvoCriteria evo) diff --git a/PKHeX.Core/Resources/legality/wild/Gen9/encounter_fixed_paldea.pkl b/PKHeX.Core/Resources/legality/wild/Gen9/encounter_fixed_paldea.pkl index 6fec4c9f4..cf9d6a563 100644 Binary files a/PKHeX.Core/Resources/legality/wild/Gen9/encounter_fixed_paldea.pkl and b/PKHeX.Core/Resources/legality/wild/Gen9/encounter_fixed_paldea.pkl differ diff --git a/PKHeX.Core/Saves/Access/SaveBlockAccessor9SV.cs b/PKHeX.Core/Saves/Access/SaveBlockAccessor9SV.cs index 7f0bede17..ce57eee0c 100644 --- a/PKHeX.Core/Saves/Access/SaveBlockAccessor9SV.cs +++ b/PKHeX.Core/Saves/Access/SaveBlockAccessor9SV.cs @@ -85,6 +85,7 @@ public SaveBlockAccessor9SV(SAV9SV sav) private const uint KFashionUnlockedPhoneCase = 0xED0AC675; private const uint KPlayerPhoto1 = 0x14C5A101; private const uint KPlayerPhoto2 = 0xF8B14C88; + private const uint KPlayerTrainerIcon = 0xD41F4FC4; private const uint KRentalTeams = 0x19CB0339; private const uint KSevenStarRaids = 0x8B14392F;