Slight typo in `heal` for Finite State Machine
WolfgangSenff opened this issue · 0 comments
WolfgangSenff commented
I'm submitting a bug report
- [x ] Bug report.
- Feature request.
Bug report
What is the current behavior?
When you heal beyond the current max health, it chooses the value above the max health. Further, if you heal once but it isn't enough to fully heal you, it currently would still fully heal you regardless.
What is the expected behavior?
The variable name max_health
implies it is a value that cannot be exceeded, so it should be choosing the minimum of the current and max health values.
Tell us the steps to reproduce the bug, and if possible share a minimal demo of the problem.
- Open FSM project
- Code it so you only heal a single hit point when healing, take nearly-fatal damage
- Heal - notice it chooses max_health because it's the max of the current health and the max.
I'll be opening a PR to fix this shortly.