[heal_unit]: ensure that heal amount is an integer
This commit is contained in:
parent
f2284e2e79
commit
76ed49a45f
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ function wesnoth.wml_actions.heal_unit(cfg)
|
|||
new_hitpoints = u.max_hitpoints
|
||||
else
|
||||
heal_amount = tonumber(cfg.amount) or heal_amount
|
||||
new_hitpoints = math.max(1, math.min(u.max_hitpoints, u.hitpoints + heal_amount))
|
||||
new_hitpoints = math.floor(math.max(1, math.min(u.max_hitpoints, u.hitpoints + heal_amount)))
|
||||
heal_amount = new_hitpoints - u.hitpoints
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue