diff options
-rw-r--r-- | Learn-moves-upon-evolution.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Learn-moves-upon-evolution.md b/Learn-moves-upon-evolution.md index 60e0eeb..b08851a 100644 --- a/Learn-moves-upon-evolution.md +++ b/Learn-moves-upon-evolution.md @@ -14,6 +14,7 @@ u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove) u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); u8 level = GetMonData(mon, MON_DATA_LEVEL, NULL); s32 i; + u32 retVal = 0; // since you can learn more than one move per level // the game needs to know whether you decided to // learn it or keep the old set to avoid asking @@ -29,11 +30,11 @@ u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove) { gMoveToLearn = gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID; sLearningMoveTableID++; - return GiveMoveToMon(mon, gMoveToLearn); + retVal = GiveMoveToMon(mon, gMoveToLearn); } sLearningMoveTableID++; } - return 0; + return retVal; } ``` This iterates through the mon's level up learnset and attempts to teach all the moves that are either level 0 or the same level as the mon. |