Skip to content

Commit

Permalink
Merge pull request #1 from AsparagusEduardo/speciestags
Browse files Browse the repository at this point in the history
Sped up name generation
  • Loading branch information
kittenchilly authored May 3, 2024
2 parents 788d3bd + c853782 commit 5908f7f
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions src/frontier_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1993,19 +1993,36 @@ static void CheckPartyIneligibility(void)

if (numEligibleMons < toChoose)
{
s32 i;
s32 i, j;
s32 baseSpecies = 0;
s32 totalCaughtBanned = 0;
s32 caughtBanned[50] = {0};
s32 caughtBanned[100] = {0};

for (i = 0; i <= NATIONAL_DEX_COUNT; i++)
for (i = 0; i < NUM_SPECIES; i++)
{
s32 species = NationalPokedexNumToSpecies(i);
if (gSpeciesInfo[species].isRestrictedLegendary || gSpeciesInfo[species].isMythical)
if (totalCaughtBanned >= ARRAY_COUNT(caughtBanned))
break;
baseSpecies = GET_BASE_SPECIES_ID(i);
if (gSpeciesInfo[baseSpecies].isRestrictedLegendary || gSpeciesInfo[baseSpecies].isMythical)
{
if (GetSetPokedexFlag(i, FLAG_GET_CAUGHT))
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(baseSpecies), FLAG_GET_CAUGHT))
{
caughtBanned[totalCaughtBanned] = species;
totalCaughtBanned++;
bool32 alreadyInList = FALSE;
for (j = 0; j < ARRAY_COUNT(caughtBanned); j++)
{
if (caughtBanned[j] == SPECIES_NONE)
break;
if (caughtBanned[j] == baseSpecies)
{
alreadyInList = TRUE;
break;
}
}
if (!alreadyInList)
{
caughtBanned[totalCaughtBanned] = baseSpecies;
totalCaughtBanned++;
}
}
}
}
Expand Down

0 comments on commit 5908f7f

Please sign in to comment.