mirror of https://github.com/pret/pokeemerald.git
Made GetPreEvolution as simple as can be
parent
07e374576c
commit
41604ef983
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue