Lua code: replace deprecated wesnoth.tovconfig() calls
(cherry-picked from commit 138107c8f6
)
This commit is contained in:
parent
e394ddd1c8
commit
448a20779f
4 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue