Elevate 63891c77a1 to work in all SLFs

The default with_border value is false. Certain functions, such as game_lua_kernel::intf_get_locations
pass an explicit true value to with_border. This commit allows any user-facing tags using those
(such as [store_locations]) to pass an explicit override.
This commit is contained in:
Charles Dang 2015-01-15 04:28:27 +11:00
parent 97971f1fb2
commit ac42e5e228
2 changed files with 4 additions and 2 deletions

View file

@ -2579,12 +2579,11 @@ int game_lua_kernel::intf_synchronize_choice(lua_State *L)
int game_lua_kernel::intf_get_locations(lua_State *L)
{
vconfig filter = luaW_checkvconfig(L, 1);
const bool with_borders = filter["include_borders"].to_bool(true);
std::set<map_location> res;
filter_context & fc = game_state_;
const terrain_filter t_filter(filter, &fc);
t_filter.get_locations(res, with_borders);
t_filter.get_locations(res, true);
lua_createtable(L, res.size(), 0);
int i = 1;

View file

@ -402,6 +402,9 @@ void terrain_filter::get_locations(std::set<map_location>& locs, bool with_borde
{
std::set<map_location> match_set;
// See if the caller provided an override to with_border
with_border = cfg_["include_borders"].to_bool(with_border);
// None of the generators provided
if ( !cfg_.has_attribute("x") && !cfg_.has_attribute("y")
&& !cfg_.has_attribute("find_in")