Skip to content

Commit

Permalink
Deprecate helper.wml_error and move it to wml.error
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Nov 12, 2018
1 parent 7cf27e1 commit 1a4df40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 7 additions & 0 deletions data/lua/core.lua
Expand Up @@ -232,6 +232,13 @@ function wesnoth.deprecate_api(elem_name, replacement, level, version, elem, det
end

if wesnoth.kernel_type() == "Game Lua Kernel" then
--[========[WML error helper]========]

--! Interrupts the current execution and displays a chat message that looks like a WML error.
function wml.error(m)
error("~wml:" .. m, 0)
end

--[========[Basic variable access]========]

-- Get all variables via wml.all_variables (read-only)
Expand Down
6 changes: 1 addition & 5 deletions data/lua/helper.lua
Expand Up @@ -19,11 +19,6 @@ function helper.get_sides(cfg)
return f, { i = 0 }
end

--! Interrupts the current execution and displays a chat message that looks like a WML error.
function helper.wml_error(m)
error("~wml:" .. m, 0)
end

--! Returns an iterator over teams that can be used in a for-in loop.
function helper.all_teams()
local function f(s)
Expand Down Expand Up @@ -247,6 +242,7 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then
helper.get_variable_array = wesnoth.deprecate_api('helper.get_variable_array', ' wml.array_access.get', 1, nil, wml.array_access.get)
helper.set_variable_array = wesnoth.deprecate_api('helper.set_variable_array', 'wml.array_access.set', 1, nil, wml.array_access.set)
helper.get_variable_proxy_array = wesnoth.deprecate_api('helper.get_variable_proxy_array', 'wml.array_access.get_proxy', 1, nil, wml.array_access.get_proxy)
helper.wml_error = wesnoth.deprecate_api('helper.wml_error', 'wml.error', 1, nil, wml.error)
end
helper.literal = wesnoth.deprecate_api('helper.literal', 'wml.literal', 1, nil, wml.literal)
helper.parsed = wesnoth.deprecate_api('helper.parsed', 'wml.parsed', 1, nil, wml.parsed)
Expand Down

0 comments on commit 1a4df40

Please sign in to comment.