From d75a752c06ddbc81f1ec5907f9eb3497d9719473 Mon Sep 17 00:00:00 2001 From: Jyrki Vesterinen Date: Mon, 16 Apr 2018 20:52:17 +0300 Subject: [PATCH] [heal_unit]: ensure that heal amount is an integer (cherry-picked from commit 76ed49a45f3679050cf06e2ab6aa5ec072957572) --- data/lua/wml/heal_unit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/lua/wml/heal_unit.lua b/data/lua/wml/heal_unit.lua index efa1b8442ad7..c1de027ad929 100644 --- a/data/lua/wml/heal_unit.lua +++ b/data/lua/wml/heal_unit.lua @@ -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