summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Learn-moves-upon-evolution.md9
1 files changed, 5 insertions, 4 deletions
diff --git a/Learn-moves-upon-evolution.md b/Learn-moves-upon-evolution.md
index 4e16576..60e0eeb 100644
--- a/Learn-moves-upon-evolution.md
+++ b/Learn-moves-upon-evolution.md
@@ -13,7 +13,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;
// 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
@@ -22,11 +22,12 @@ u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove)
{
sLearningMoveTableID = 0;
}
- while(gLevelUpLearnsets[species][sLearningMoveTableID].move != LEVEL_UP_END)
+ for (i = 0; gLevelUpLearnsets[species][i] != LEVEL_UP_END; i++)
{
- while (!gLevelUpLearnsets[species][sLearningMoveTableID].level || gLevelUpLearnsets[species][sLearningMoveTableID].level == level)
+ moveLevel = gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_LV;
+ while (moveLevel == 0 || moveLevel == (level << 9))
{
- gMoveToLearn = gLevelUpLearnsets[species][sLearningMoveTableID].move;
+ gMoveToLearn = gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID;
sLearningMoveTableID++;
return GiveMoveToMon(mon, gMoveToLearn);
}