Open PLMMJ-FH opened 3 weeks ago
It leveled up immediately after and everything was resolved (HP at proper max of 95)
That's because you get auto-healed after a boss wave. If you had checked your Pokémon's HP from the party menu you would have seen it at 71/95 (or something similar).
For some reason when a Pokémon evolves there's a stale reference somewhere causing the Pokémon's HP to not be updated properly when it evolves.
After investigating for a bit, a possible reason is here in src/field/pokemon.ts/PlayerPokemon:getPossibleEvolution()
(specifically line 3151 -> 3153): https://github.com/pagefaultgames/pokerogue/blob/fd7e547750a6109a955343a77d75c5994fceaf34/src/field/pokemon.ts#L3136-L3155
First the HP is calculated properly, but then it re-calculates using the original HP value and doesn't re-increase it to where it should be. I think the line(s) mentioned are causing the unnecessary first calculateStats()
call and/or the stale reference which is messing things up.
The Pokémon I tested with in the image was Bulbasaur->Ivysaur Lv15->16.
This really bizarre bug happened while I wasn't paying attention. So I was fighting Surge, and my Toxtricity evolved. But when I had to send it out, until he hit me, its HP says 71/71, but its bar displays a bit of damage. It leveled up immediately after and everything was resolved (HP at proper max of 95)![PokerogueWhyAreYouSoBroken](https://github.com/pagefaultgames/pokerogue/assets/159862724/130fb3e7-d7d3-4106-9cf2-7981e2947733)