Introduce inline SSF support in [gold] and deprecate [gold][filter_side].

Since it should never have been added and is now redundant.
This commit is contained in:
Anonymissimus 2012-02-14 21:22:32 +00:00
parent c44e2ea3ad
commit 679f18801c

View file

@ -56,7 +56,16 @@ end
function wml_actions.gold(cfg)
local amount = tonumber(cfg.amount) or
helper.wml_error "[gold] missing required amount= attribute."
for index, team in ipairs(wesnoth.get_sides(nil, cfg, false)) do
local sides = cfg.side
local filter_side = helper.get_child(cfg, "filter_side")
if filter_side then
wesnoth.message("warning", "[gold][filter_side] is deprecated, use only an inline SSF")
if sides then helper.wml_error("duplicate side information in [gold]") end
sides = wesnoth.get_sides(filter_side)
else
sides = wesnoth.get_sides(cfg)
end
for index, team in ipairs(sides) do
team.gold = team.gold + amount
end
end