world-of-might-and-magic
world-of-might-and-magic copied to clipboard
Vanilla bug - HP can exceed MaxHP
Describe the bug Subj.
To Reproduce
- Cast day of the gods.
- Heal.
- Wait for it to expire.
- HP stays > MaxHP.
Any subsequent health regen source will snap HP down to MaxHP. Damage can be taken as normal with hp > Max without snap.
The same applies to MP.
Expected behavior Ultimately, the behaviour is inconsistent and there are two possible fixes:
- HP never exceeds MaxHP
- Regen doesn't snap HP back to MaxHP
Environment (please complete the following information):
- OS: OSX
- Architecture: M1
Screenshots None.
Saved game file None.
Additional context
Breaking commit https://github.com/OpenEnroth/OpenEnroth/commit/4bd992a796a91b9caebb939208360e4f03755be8
Should redo the code there like this:
character.health = std::max(character.health, std::min(character.GetMaxHealth(), character.health + ticks5));
I believe our current behavior matches vanilla so moving to milestone 0.2.