mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-10-01 13:26:39 -05:00
@@ -83,7 +83,16 @@ public int GetRandomSpecies(int oldSpecies)
|
||||
loopctr = 0; // altering calculations to prevent infinite loops
|
||||
int newSpecies;
|
||||
while (!GetNewSpecies(oldSpecies, oldpkm, out newSpecies))
|
||||
{
|
||||
if (loopctr > 0x0001_0000)
|
||||
{
|
||||
PersonalInfo pkm = SpeciesStat[newSpecies];
|
||||
if (IsSpeciesBSTBad(oldpkm, pkm) && loopctr > 0x0001_1000) // keep trying for at minimum BST
|
||||
continue;
|
||||
return newSpecies; // failed to find any match based on criteria, return random species that may or may not match criteria
|
||||
}
|
||||
loopctr++;
|
||||
}
|
||||
return newSpecies;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user