mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-10-02 05:46:47 -05:00
Tweak A->A prevention logic
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user