diff options
author | garak <garakmon@gmail.com> | 2018-10-17 12:30:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-17 12:30:45 -0400 |
commit | 7d88b9647f92d099177fc734f32e94fc472f2cbf (patch) | |
tree | 3b3d6ea2a092b2fd482d03145094689a05ec1b92 /src/pokemon.c | |
parent | ff97873c309e28beec91efe11393c093a08b19d3 (diff) | |
parent | f67bbbdaaa905833f1c2a315624128aafef9a4cb (diff) |
Merge branch 'master' into event-flags
Diffstat (limited to 'src/pokemon.c')
-rw-r--r-- | src/pokemon.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pokemon.c b/src/pokemon.c index 40f7e94b2..7227d28cb 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3251,7 +3251,7 @@ u8 GetLevelFromMonExp(struct Pokemon *mon) u32 exp = GetMonData(mon, MON_DATA_EXP, NULL); s32 level = 1; - while (level <= MAX_MON_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp) + while (level <= MAX_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp) level++; return level - 1; @@ -3263,7 +3263,7 @@ u8 GetLevelFromBoxMonExp(struct BoxPokemon *boxMon) u32 exp = GetBoxMonData(boxMon, MON_DATA_EXP, NULL); s32 level = 1; - while (level <= MAX_MON_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp) + while (level <= MAX_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp) level++; return level - 1; @@ -5145,7 +5145,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov retVal = FALSE; } if ((itemEffect[cmdIndex] & 0x40) // raise level - && GetMonData(mon, MON_DATA_LEVEL, NULL) != MAX_MON_LEVEL) + && GetMonData(mon, MON_DATA_LEVEL, NULL) != MAX_LEVEL) { dataUnsigned = gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL) + 1]; SetMonData(mon, MON_DATA_EXP, &dataUnsigned); @@ -6430,12 +6430,12 @@ bool8 TryIncrementMonLevel(struct Pokemon *mon) u16 species = GetMonData(mon, MON_DATA_SPECIES, 0); u8 nextLevel = GetMonData(mon, MON_DATA_LEVEL, 0) + 1; u32 expPoints = GetMonData(mon, MON_DATA_EXP, 0); - if (expPoints > gExperienceTables[gBaseStats[species].growthRate][MAX_MON_LEVEL]) + if (expPoints > gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]) { - expPoints = gExperienceTables[gBaseStats[species].growthRate][MAX_MON_LEVEL]; + expPoints = gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]; SetMonData(mon, MON_DATA_EXP, &expPoints); } - if (nextLevel > MAX_MON_LEVEL || expPoints < gExperienceTables[gBaseStats[species].growthRate][nextLevel]) + if (nextLevel > MAX_LEVEL || expPoints < gExperienceTables[gBaseStats[species].growthRate][nextLevel]) { return FALSE; } |