diff --git a/data/lua/core.lua b/data/lua/core.lua index ac532a4f1c44..1bb58972129f 100644 --- a/data/lua/core.lua +++ b/data/lua/core.lua @@ -943,6 +943,8 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then wesnoth.delete_ai_component = wesnoth.deprecate_api('wesnoth.delete_ai_component', 'wesnoth.sides.delete_ai_component', 1, nil, wesnoth.sides.delete_ai_component) wesnoth.change_ai_component = wesnoth.deprecate_api('wesnoth.change_ai_component', 'wesnoth.sides.change_ai_component', 1, nil, wesnoth.sides.change_ai_component) wesnoth.get_sides = wesnoth.deprecate_api('wesnoth.get_sides', 'wesnoth.sides.find', 1, nil, wesnoth.sides.find) + wesnoth.create_animator = wesnoth.deprecate_api('wesnoth.create_animator', 'wesnoth.units.create_animator', 1, nil, wesnoth.units.create_animator) + wesnoth.create_weapon = wesnoth.deprecate_api('wesnoth.create_weapon', 'wesnoth.units.create_weapon', 1, nil, wesnoth.units.create_weapon) -- Audio module wesnoth.play_sound = wesnoth.deprecate_api('wesnoth.play_sound', 'wesnoth.audio.play', 1, nil, wesnoth.audio.play) wesnoth.sound_volume = wesnoth.deprecate_api('wesnoth.sound_volume', 'wesnoth.audio.volume', 1, nil, function(volume) diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index c1bffa54bad4..b1849fe707c9 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -4112,7 +4112,6 @@ game_lua_kernel::game_lua_kernel(game_state & gs, play_controller & pc, reports // Put some callback functions in the scripting environment. static luaL_Reg const callbacks[] { { "add_known_unit", &intf_add_known_unit }, - { "create_animator", &dispatch<&game_lua_kernel::intf_create_animator> }, { "eval_conditional", &intf_eval_conditional }, { "get_era", &intf_get_era }, { "get_resource", &intf_get_resource }, @@ -4276,6 +4275,7 @@ game_lua_kernel::game_lua_kernel(game_state & gs, play_controller & pc, reports {"find_on_recall", &dispatch<&game_lua_kernel::intf_get_recall_units>}, {"get", &dispatch<&game_lua_kernel::intf_get_unit>}, {"get_hovered", &dispatch<&game_lua_kernel::intf_get_displayed_unit>}, + {"create_animator", &dispatch<&game_lua_kernel::intf_create_animator>}, { nullptr, nullptr } }; lua_getglobal(L, "wesnoth"); diff --git a/src/scripting/lua_unit_attacks.cpp b/src/scripting/lua_unit_attacks.cpp index 782639e1e862..0491220b2b33 100644 --- a/src/scripting/lua_unit_attacks.cpp +++ b/src/scripting/lua_unit_attacks.cpp @@ -391,7 +391,7 @@ namespace lua_units { lua_setfield(L, -2, "matches"); // Add create_attack - luaW_getglobal(L, "wesnoth"); + luaW_getglobal(L, "wesnoth", "units"); lua_pushcfunction(L, intf_create_attack); lua_setfield(L, -2, "create_weapon"); lua_pop(L, 1);