Made GetPreEvolution as simple as can be

voloved 2023-04-06 09:58:33 -04:00
parent 07e374576c
commit 41604ef983
1 changed files with 7 additions and 15 deletions

@ -38,25 +38,17 @@ EWRAM_DATA u8 gPlayerPartyCount = 0;
}
+static u16 GetPreEvolution(u16 species){
+ int i, j, k;
+ u16 preEvolution = SPECIES_NONE;
+ bool8 found;
+ found = FALSE;
+ for (j = 1; j < NUM_SPECIES; j++)
+ int i, j;
+
+ for (i = 1; i < NUM_SPECIES; i++)
+ {
+ for (k = 0; k < EVOS_PER_MON; k++)
+ for (j = 0; j < EVOS_PER_MON; j++)
+ {
+ if (gEvolutionTable[j][k].targetSpecies == species)
+ {
+ preEvolution= j;
+ found = TRUE;
+ break;
+ }
+ if (gEvolutionTable[i][j].targetSpecies == species)
+ return i;
+ }
+ if (found)
+ break;
+ }
+ return preEvolution;
+ return SPECIES_NONE;
+}
+
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)