Tweak A->A prevention logic

This commit is contained in:
Kurt
2015-07-05 16:02:20 -07:00
parent d9c96a951d
commit 47315935bf

View File

@@ -169,13 +169,14 @@ private void B_RandAll_Click(object sender, EventArgs e)
{
// Get a new random species
int oldSpecies = rb[j].SelectedIndex;
int currentSpecies = Array.IndexOf(specieslist, CB_Species.Text);
int loopctr = 0; // altering calculatiosn to prevent infinite loops
defspecies:
int newSpecies = Randomizer.getRandomSpecies(ref sL, ref ctr);
loopctr++;
// Verify it meets specifications
if (newSpecies == CB_Species.SelectedIndex // no A->A evolutions
if (newSpecies == currentSpecies // no A->A evolutions
|| (newSpecies == oldSpecies && loopctr < 722 * 5)) // prevent runaway calcs
{ goto defspecies; }
if (rEXP) // Experience Growth Rate matches