[Lua.MapGen] wesnoth.map.find[_in_radius] already accepted either a single location or a list of locations for their in_list and center params, respectively.
find_in_radius accepted the single location as two separate integer paramters, while find did not. This corrects that inconsistency.
This commit is contained in:
parent
17eccf1a74
commit
c2a19316a4
1 changed files with 2 additions and 1 deletions
|
@ -167,6 +167,7 @@ static std::set<map_location> luaW_to_locationset(lua_State* L, int index)
|
|||
res.insert(single);
|
||||
return res;
|
||||
}
|
||||
if(!lua_istable(L, index)) return res;
|
||||
lua_pushvalue(L, index);
|
||||
size_t len = lua_rawlen(L, -1);
|
||||
for(size_t i = 0; i != len; ++i) {
|
||||
|
@ -673,7 +674,7 @@ int intf_mg_get_locations(lua_State* L)
|
|||
const auto f = luaW_check_mgfilter(L, 2, true);
|
||||
location_set res;
|
||||
LOG_LMG << "map:get_locations vaidargs";
|
||||
if(lua_istable(L, 3)) {
|
||||
if(!lua_isnone(L, 3)) {
|
||||
LOG_LMG << "map:get_locations some locations";
|
||||
location_set s = luaW_to_locationset(L, 3);
|
||||
LOG_LMG << "map:get_locations #args = " << s.size();
|
||||
|
|
Loading…
Add table
Reference in a new issue