diff --git a/Allow-Move-Relearner-to-Teach-Moves-that-Pre-Evolutions-Know.md b/Allow-Move-Relearner-to-Teach-Moves-that-Pre-Evolutions-Know.md index 8c56ab5..40bed29 100644 --- a/Allow-Move-Relearner-to-Teach-Moves-that-Pre-Evolutions-Know.md +++ b/Allow-Move-Relearner-to-Teach-Moves-that-Pre-Evolutions-Know.md @@ -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)