diff --git a/PKHeX.Core/Saves/SAV3.cs b/PKHeX.Core/Saves/SAV3.cs index 67c2d27e6..9251c5409 100644 --- a/PKHeX.Core/Saves/SAV3.cs +++ b/PKHeX.Core/Saves/SAV3.cs @@ -298,6 +298,21 @@ public sealed override string ChecksumInfo } } + public static bool IsMail(int itemID) => (uint)(itemID - 121) <= (132 - 121); + + protected override void SetPartyValues(PKM pk, bool isParty) + { + if (pk is not PK3 p3) + return; + + // If no mail ID is set, ensure it is set to 0xFF for party and 0x00 for box format. + // Box format doesn't store this value, but set it anyway for clarity. + if (!IsMail(p3.HeldItem)) + p3.HeldMailID = isParty ? (sbyte)-1 : (sbyte)0; + + base.SetPartyValues(pk, isParty); + } + public abstract uint SecurityKey { get; set; } public sealed override string OT