Skip to content

Commit

Permalink
Clarify PersonalInfoSM local bool
Browse files Browse the repository at this point in the history
FormVariantEggMoves are used?
#774
  • Loading branch information
kwsch committed Jan 30, 2017
1 parent 9506b3b commit bcf4c72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions PKHeX/Legality/Core.cs
Expand Up @@ -987,11 +987,9 @@ private static IEnumerable<int> getEggMoves(PKM pkm, int species, int formnum)
case 6: // entries per species
return EggMovesAO[species].Moves.Concat(EggMovesXY[species].Moves);

case 7: // entries per form
if (species == 678)
{ species = 677; formnum = 0; }
case 7: // entries per form if required
var entry = EggMovesSM[species];
if (formnum > 0)
if (formnum > 0 && ((PersonalInfoSM)PersonalTable.SM[species]).FormVariantEggMoves)
entry = EggMovesSM[entry.FormTableIndex + formnum - 1];
return entry.Moves;

Expand Down
2 changes: 1 addition & 1 deletion PKHeX/PersonalInfo/PersonalInfoSM.cs
Expand Up @@ -25,6 +25,6 @@ public override byte[] Write()
public int SpecialZ_Item { get { return BitConverter.ToUInt16(Data, 0x4C); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x4C); } }
public int SpecialZ_BaseMove { get { return BitConverter.ToUInt16(Data, 0x4E); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x4E); } }
public int SpecialZ_ZMove { get { return BitConverter.ToUInt16(Data, 0x50); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x50); } }
public bool LocalVariant { get { return Data[0x52] == 1; } set { Data[0x52] = (byte)(value ? 1 : 0); } }
public bool FormVariantEggMoves { get { return Data[0x52] == 1; } set { Data[0x52] = (byte)(value ? 1 : 0); } }
}
}

0 comments on commit bcf4c72

Please sign in to comment.