From 47315935bf1194d4fae363a47e947987ca2fca57 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 5 Jul 2015 16:02:20 -0700 Subject: [PATCH] Tweak A->A prevention logic --- pk3DS/Subforms/Evolution.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pk3DS/Subforms/Evolution.cs b/pk3DS/Subforms/Evolution.cs index 92ca8cb..a05d258 100644 --- a/pk3DS/Subforms/Evolution.cs +++ b/pk3DS/Subforms/Evolution.cs @@ -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