From b24714a5973d04ee0fce7457854d82ac93c25c91 Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Mon, 22 Apr 2024 14:03:55 +0100 Subject: [PATCH] Fix GiveBoxMonInitialMoveset_Fast --- src/pokemon.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 0e145c2e4b..5b1a10a908 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1689,7 +1689,7 @@ void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon) //Credit: Asparagu u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL); s32 level = GetLevelFromBoxMonExp(boxMon); s32 i; - u16 moves[MAX_MON_MOVES] = {0}; + u16 moves[MAX_MON_MOVES] = {MOVE_NONE}; u8 addedMoves = 0; const struct LevelUpMove *learnset = GetSpeciesLevelUpLearnset(species); @@ -1703,13 +1703,15 @@ void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon) //Credit: Asparagu if (learnset[i].level == 0) continue; - for (j = 0; j < addedMoves + 1; j++) + for (j = 0; j < addedMoves; j++) + { if (moves[j] == learnset[i].move) { alreadyKnown = TRUE; break; } - + } + if (!alreadyKnown) { if (addedMoves < MAX_MON_MOVES)