Disallow move suggestions for formats < 6

Flip requirement from gennumber to format (since the moves are learnable
on said format)
This commit is contained in:
Kurt
2016-11-14 22:16:51 -08:00
parent c0a478f0cc
commit b7bef82b84
2 changed files with 4 additions and 1 deletions

View File

@@ -210,7 +210,7 @@ public int[] getSuggestedRelearn()
}
public int[] getSuggestedMoves(bool tm, bool tutor)
{
if (pkm.GenNumber < 6)
if (pkm.Format < 6)
return null;
return Legal.getValidMoves(pkm, Tutor: tutor, Machine: tm).Skip(1).ToArray(); // skip move 0
}

View File

@@ -1784,6 +1784,9 @@ private void clickMoves(object sender, EventArgs e)
{
bool random = ModifierKeys == Keys.Control;
int[] m = Legality.getSuggestedMoves(tm: random, tutor: random);
if (m == null)
{ Util.Alert("Suggestions are not enabled for this PKM format."); return; }
if (random)
Util.Shuffle(m);
if (m.Length > 4)