mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-02 12:56:52 -05:00
Update pk3.HeldMailID when not holding mail
https://projectpokemon.org/home/forums/topic/64361-bugs-when-editing-g3-japanese-version-pokemon/?do=findComment&comment=287038
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user