From 7f0b1da56160f79cb4b82edb2f1d255ffcc2fd8e Mon Sep 17 00:00:00 2001 From: Zimmermann Gyula Date: Wed, 6 Dec 2023 18:05:04 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20HGSS=20Pok=C3=A9dex=20teachable=20moves?= =?UTF-8?q?=20list.=20(#3624)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> --- src/pokedex_plus_hgss.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/pokedex_plus_hgss.c b/src/pokedex_plus_hgss.c index 294d42b26e..18ea0824e1 100644 --- a/src/pokedex_plus_hgss.c +++ b/src/pokedex_plus_hgss.c @@ -5276,14 +5276,30 @@ static bool8 CalculateMoves(void) { sStatsMovesTMHM_ID[numTMHMMoves] = (ITEM_TM01 + j); numTMHMMoves++; + + sStatsMoves[movesTotal] = move; + movesTotal++; break; } } - if (j >= NUM_TECHNICAL_MACHINES + NUM_HIDDEN_MACHINES) - numTutorMoves++; + } - sStatsMoves[movesTotal] = move; - movesTotal++; + for (i = 0; gTeachableLearnsets[species][i] != MOVE_UNAVAILABLE; i++) + { + move = gTeachableLearnsets[species][i]; + for (j = 0; j < NUM_TECHNICAL_MACHINES + NUM_HIDDEN_MACHINES; j++) + { + if (ItemIdToBattleMoveId(ITEM_TM01 + j) == move) + break; + } + + if (j >= NUM_TECHNICAL_MACHINES + NUM_HIDDEN_MACHINES) + { + numTutorMoves++; + + sStatsMoves[movesTotal] = move; + movesTotal++; + } } sPokedexView->numEggMoves = numEggMoves;