From b275d12a974bb1df92edf38e5bb32267339469ad Mon Sep 17 00:00:00 2001 From: Philippe Symons Date: Thu, 25 Jul 2024 10:40:08 +0200 Subject: [PATCH] Also recalculate lvl in gen1_recalculatePokeStats --- src/gen1/Gen1Common.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gen1/Gen1Common.cpp b/src/gen1/Gen1Common.cpp index a67faa3..1a39350 100644 --- a/src/gen1/Gen1Common.cpp +++ b/src/gen1/Gen1Common.cpp @@ -142,6 +142,7 @@ void gen1_recalculatePokeStats(Gen1GameReader& reader, Gen1TrainerPokemon& poke) Gen1PokeStats stats; reader.readPokemonStatsForIndex(poke.poke_index, stats); + poke.level = getLevelForExp(poke.exp, stats.growth_rate); poke.max_hp = calculatePokeStat(PokeStat::HP, stats.base_hp, getStatIV(PokeStat::HP, poke.iv_data), poke.hp_effort_value, poke.level); poke.atk = calculatePokeStat(PokeStat::ATK, stats.base_attack, getStatIV(PokeStat::ATK, poke.iv_data), poke.atk_effort_value, poke.level); poke.def = calculatePokeStat(PokeStat::DEF, stats.base_defense, getStatIV(PokeStat::DEF, poke.iv_data), poke.def_effort_value, poke.level);