Fix a variable referenced out of its scope (bug #19803)

This commit is contained in:
Anonymissimus 2012-06-13 21:58:01 +00:00
parent b207a1b1ca
commit 6f48761f93

View File

@ -204,6 +204,7 @@ function wml_actions.objectives(cfg)
end end
function wml_actions.show_objectives(cfg) function wml_actions.show_objectives(cfg)
local cfg0 = scenario_objectives[0]
local function local_show_objectives(sides) local function local_show_objectives(sides)
local objectives0 = cfg0 and generate_objectives(cfg0) local objectives0 = cfg0 and generate_objectives(cfg0)
for i, team in ipairs(sides) do for i, team in ipairs(sides) do
@ -214,7 +215,6 @@ function wml_actions.show_objectives(cfg)
end end
end end
local sides = wesnoth.get_sides(cfg) local sides = wesnoth.get_sides(cfg)
local cfg0 = scenario_objectives[0]
if #sides == 0 then if #sides == 0 then
local_show_objectives(wesnoth.sides) local_show_objectives(wesnoth.sides)
else else