by layer8 · 3y ago · 0 comments
I don't see how that couldn't run into similar problems. I would use `clamp(old_hp * (new_maxhp / old_maxhp), 1, new_maxhp)` (assuming that old_hp >= 1).
Otherwise you get loss from the division and then multiply that loss (by >1).