mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-14 18:45:15 -05:00
Fix Transfer Ability 4->6
Clear Shiny Leaves/Crown, and fix ability detection
This commit is contained in:
@@ -156,9 +156,6 @@ public PK4(byte[] decryptedData = null, string ident = null)
|
||||
public bool FatefulEncounter { get { return (Data[0x40] & 1) == 1; } set { Data[0x40] = (byte)(Data[0x40] & ~0x01 | (value ? 1 : 0)); } }
|
||||
public int Gender { get { return (Data[0x40] >> 1) & 0x3; } set { Data[0x40] = (byte)(Data[0x40] & ~0x06 | (value << 1)); } }
|
||||
public int AltForm { get { return Data[0x40] >> 3; } set { Data[0x40] = (byte)(Data[0x40] & 0x07 | (value << 3)); } }
|
||||
public int Nature { get { return Data[0x41]; } set { Data[0x41] = (byte)value; } }
|
||||
public bool HiddenAbility { get { return (Data[0x41] & 1) == 1; } set { Data[0x41] = (byte)(Data[0x41] & ~0x01 | (value ? 1 : 0)); } }
|
||||
public bool NPokémon { get { return (Data[0x41] & 2) == 2; } set { Data[0x41] = (byte)(Data[0x41] & ~0x02 | (value ? 2 : 0)); } }
|
||||
// 0x43-0x47 Unused
|
||||
#endregion
|
||||
|
||||
@@ -425,6 +422,7 @@ public PK5 convertToPK5()
|
||||
: 30001; // Pokétransfer (not Crown)
|
||||
|
||||
// Delete HGSS Data
|
||||
pk5.Data[0x41] = 0; // Shiny Leaves/Crown
|
||||
BitConverter.GetBytes((ushort)0).CopyTo(pk5.Data, 0x86);
|
||||
if (HGSSBall > 0 && HGSSBall != 4)
|
||||
pk5.Ball = HGSSBall;
|
||||
|
||||
@@ -262,7 +262,7 @@ internal static byte[] getAbilities(int species, int formnum)
|
||||
internal static int getAbilityNumber(int species, int ability, int formnum)
|
||||
{
|
||||
byte[] spec_abilities = Personal[Personal[species].FormeIndex(species, formnum)].Abilities;
|
||||
int abilval = Array.IndexOf(spec_abilities, ability);
|
||||
int abilval = Array.IndexOf(spec_abilities, (byte)ability);
|
||||
if (abilval >= 0)
|
||||
return 1 << abilval;
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user