diff --git a/data/lua/core.lua b/data/lua/core.lua index ec8a1f535e1c..ee98a934e0b3 100644 --- a/data/lua/core.lua +++ b/data/lua/core.lua @@ -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) diff --git a/data/lua/helper.lua b/data/lua/helper.lua index 564c59f9512b..945a22accf4c 100644 --- a/data/lua/helper.lua +++ b/data/lua/helper.lua @@ -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) @@ -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)