From 7c299ce4187076031c2c8ccc6c4a1dc65bf67d74 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Sat, 28 May 2016 03:29:14 +1100 Subject: [PATCH] Fixed [lift_fog] (bug #24680) Firstly, there was a typo in the parse_fog_cfg utility function. Secondly, wesnoth.get_sides returns a table of side proxy tables, not a list of side numbers. I changed [lift_fog] and [reset_fog] to iterate through the table returned by parse_fog_cfg. --- data/lua/wml-tags.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/data/lua/wml-tags.lua b/data/lua/wml-tags.lua index e12a165b7b7..ed6d135ae9a 100644 --- a/data/lua/wml-tags.lua +++ b/data/lua/wml-tags.lua @@ -1024,7 +1024,7 @@ end local function parse_fog_cfg(cfg) -- Side filter - local ssf = helper.child(cfg, "filter_side") + local ssf = helper.get_child(cfg, "filter_side") local sides = wesnoth.get_sides(ssf or {}) -- Location filter local locs = wesnoth.get_locations(cfg) @@ -1033,10 +1033,14 @@ end function wml_actions.lift_fog(cfg) local locs, sides = parse_fog_cfg(cfg) - wesnoth.remove_fog(sides, locs, not cfg.multiturn) + for i = 1, #sides do + wesnoth.remove_fog(sides[i].side, locs, not cfg.multiturn) + end end function wml_actions.reset_fog(cfg) local locs, sides = parse_fog_cfg(cfg) - wesnoth.add_fog(sides, locs, cfg.reset_view) + for i = 1, #sides do + wesnoth.add_fog(sides[i].side, locs, cfg.reset_view) + end end