pokerogue icon indicating copy to clipboard operation
pokerogue copied to clipboard

[Bug] Fix Pokemon not gaining HP when evolving

Open DayKev opened this issue 6 months ago • 3 comments

What are the changes?

When a Pokémon evolves its current HP will increase by the same amount that its max HP does.

Why am I doing these changes?

Fixes #2352

What did change?

When creating a new Pokemon object, calculateStats() is not called if already existing stats are passed through the constructor.

Screenshots/Videos

Before fix:

https://github.com/user-attachments/assets/2081477d-151b-4d10-8728-81ff7b8c7453

After fix:

https://github.com/user-attachments/assets/46c9462c-9442-406e-96bf-14a07d67c848

How to test the changes?

Evolve a Pokémon in the same conditions pre- and post-patch.

Checklist

  • [x] I'm using beta as my base branch
  • [x] There is no overlap with another PR?
  • [x] The PR is self-contained and cannot be split into smaller PRs?
  • [x] Have I provided a clear explanation of the changes?
  • [x] Have I considered writing automated tests for the issue?
  • [x] Have I tested the changes (manually)?
    • [x] Are all unit tests still passing? (npm run test)
  • ~[ ] Are the changes visual?~
    • ~[ ] Have I provided screenshots/videos of the changes?~

DayKev avatar Aug 16 '24 07:08 DayKev