Length check suggested moves

Resize to 4
This commit is contained in:
Kurt 2016-11-14 23:02:27 -08:00
parent b7bef82b84
commit 78a408944f

View File

@ -1791,7 +1791,7 @@ private void clickMoves(object sender, EventArgs e)
Util.Shuffle(m);
if (m.Length > 4)
m = m.Skip(m.Length - 4).ToArray();
Array.Resize(ref m, 4);
string r = string.Join(Environment.NewLine, m.Select(v => v >= GameStrings.movelist.Length ? "ERROR" : GameStrings.movelist[v]));
if (DialogResult.Yes != Util.Prompt(MessageBoxButtons.YesNo, "Apply suggested current moves?", r))
return;