From 3735b9c4f2919356ddfd4d4daa04f775c69edf5e Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Thu, 5 Apr 2018 20:58:21 -0400 Subject: [PATCH] Add [move_unit]clear_shroud= as an attempt to clear shroud as the unit moves (untested) (cherry-picked from commit b062b19e10c85faecf65246e94ec8dbbad0ad4ed) --- data/lua/wml/move_unit.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data/lua/wml/move_unit.lua b/data/lua/wml/move_unit.lua index f80dfa7bd599..5b05d9b3ba52 100644 --- a/data/lua/wml/move_unit.lua +++ b/data/lua/wml/move_unit.lua @@ -53,11 +53,12 @@ function wesnoth.wml_actions.move_unit(cfg) helper.wml_error(coordinate_error) end local fire_event = cfg.fire_event + local unshroud = cfg.clear_shroud local muf_force_scroll = cfg.force_scroll local check_passability = cfg.check_passability if check_passability == nil then check_passability = true end cfg = wml.literal(cfg) - cfg.to_location, cfg.to_x, cfg.to_y, cfg.fire_event = nil + cfg.to_location, cfg.to_x, cfg.to_y, cfg.fire_event, cfg.clear_shroud = nil local units = wesnoth.get_units(cfg) for current_unit_index, current_unit in ipairs(units) do @@ -102,6 +103,10 @@ function wesnoth.wml_actions.move_unit(cfg) local x2, y2 = current_unit.x, current_unit.y current_unit.x, current_unit.y = x, y wesnoth.put_unit(current_unit) + + if unshroud then + wesnoth.wml_actions.redraw {clear_shroud=true} + end if fire_event then wesnoth.fire_event("moveto", x, y, x2, y2)