Skip to content

Commit

Permalink
Lua code: replace deprecated wesnoth.tovconfig() calls
Browse files Browse the repository at this point in the history
(cherry-picked from commit 138107c)
  • Loading branch information
mattsc committed Oct 7, 2018
1 parent e394ddd commit 448a207
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data/lua/backwards-compatibility.lua
Expand Up @@ -8,5 +8,5 @@ wesnoth.set_music = wesnoth.deprecate_api('wesnoth.set_music', 'wesnoth.music_li
-- which also provides "constness" of the passed wml object from the point of view of the caller.
-- So please don't remove since it's not deprecated.
function wesnoth.fire(name, cfg)
wesnoth.wml_actions[name](wesnoth.tovconfig(cfg or {}))
wesnoth.wml_actions[name](wml.tovconfig(cfg or {}))
end
2 changes: 1 addition & 1 deletion data/lua/wml-flow.lua
Expand Up @@ -101,7 +101,7 @@ wesnoth.wml_actions["for"] = function(cfg)
loop_lim.last = cfg_lit["end"] or first
loop_lim.step = cfg_lit.step or 1
end
loop_lim = wesnoth.tovconfig(loop_lim)
loop_lim = wml.tovconfig(loop_lim)
if loop_lim.step == 0 then -- Sanity check
helper.wml_error("[for] has a step of 0!")
end
Expand Down
4 changes: 2 additions & 2 deletions data/lua/wml-utils.lua
Expand Up @@ -127,7 +127,7 @@ function utils.handle_event_commands(cfg, scope_type)
elseif string.sub(from, -1) ~= ']' then
insert_from = from
end
arg = wesnoth.tovconfig(arg)
arg = wml.tovconfig(arg)
end
if not string.find(cmd, "^filter") then
cmd = wesnoth.wml_actions[cmd] or
Expand All @@ -139,7 +139,7 @@ function utils.handle_event_commands(cfg, scope_type)
if current_exit ~= "none" then break end
j = j + 1
if j >= wesnoth.get_variable(insert_from .. ".length") then break end
arg = wesnoth.tovconfig(wesnoth.get_variable(string.format("%s[%d]", insert_from, j)))
arg = wml.tovconfig(wesnoth.get_variable(string.format("%s[%d]", insert_from, j)))
until false
else
cmd(arg)
Expand Down
2 changes: 1 addition & 1 deletion data/lua/wml/objectives.lua
Expand Up @@ -205,7 +205,7 @@ end
local function maybe_parsed(cfg)
if cfg == nil then return nil end
if cfg.delayed_variable_substitution == true then
return wesnoth.tovconfig(cfg)
return wml.tovconfig(cfg)
end
return cfg
end
Expand Down

0 comments on commit 448a207

Please sign in to comment.