Skip to content

Commit

Permalink
Fixed [lift_fog] (bug #24680)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vultraz committed May 27, 2016
1 parent c2063c7 commit 7c299ce
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions data/lua/wml-tags.lua
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit 7c299ce

Please sign in to comment.