diff --git a/data/lua/core.lua b/data/lua/core.lua index df9c07550f17..2a80417b0c06 100644 --- a/data/lua/core.lua +++ b/data/lua/core.lua @@ -744,8 +744,8 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then return setmetatable({x = x, y = y}, hex_mt) end - function wesnoth.map.get_hexes(cfg) - local hexes = wesnoth.map.get_locations(cfg) + function wesnoth.map.find_hexes(cfg) + local hexes = wesnoth.map.find_locations(cfg) for i = 1, #hexes do hexes[i] = wesnoth.map.get_hex(hexes[i].x, hexes[i].y) end @@ -1003,9 +1003,9 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then wesnoth.label = wesnoth.deprecate_api('wesnoth.label', 'wesnoth.map.add_label', 1, nil, wesnoth.map.add_label) wesnoth.add_time_area = wesnoth.deprecate_api('wesnoth.add_time_area', 'wesnoth.map.place_area', 1, nil, wesnoth.map.place_area) wesnoth.remove_time_area = wesnoth.deprecate_api('wesnoth.remove_time_are', 'wesnoth.map.remove_area', 1, nil, wesnoth.map.remove_area) - wesnoth.get_locations = wesnoth.deprecate_api('wesnoth.get_locations', 'wesnoth.map.get_locations', 1, nil, wesnoth.map.get_locations) - wesnoth.get_villages = wesnoth.deprecate_api('wesnoth.get_locations', 'wesnoth.map.get_locations', 1, nil, function(cfg) - return wesnoth.map.get_locations{ + wesnoth.get_locations = wesnoth.deprecate_api('wesnoth.get_locations', 'wesnoth.map.find_locations', 1, nil, wesnoth.map.find_locations) + wesnoth.get_villages = wesnoth.deprecate_api('wesnoth.get_locations', 'wesnoth.map.find_locations', 1, nil, function(cfg) + return wesnoth.map.find_locations{ gives_income = true, wml.tag["and"](cfg) } diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index a7f2afa8190d..d282a8618c08 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -4148,7 +4148,7 @@ game_lua_kernel::game_lua_kernel(game_state & gs, play_controller & pc, reports {"place_area", &dispatch<&game_lua_kernel::intf_add_time_area>}, {"remove_area", &dispatch<&game_lua_kernel::intf_remove_time_area>}, // Filters - {"get_locations", &dispatch<&game_lua_kernel::intf_get_locations>}, + {"find_locations", &dispatch<&game_lua_kernel::intf_get_locations>}, {"match_location", &dispatch<&game_lua_kernel::intf_match_location>}, { nullptr, nullptr } };