mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-10 18:08:36 +00:00
some lines got left out of my previous commit somehow
This commit is contained in:
parent
0955f85065
commit
6f47d2c9fc
@ -816,11 +816,17 @@ void gamemap::get_locations(std::set<gamemap::location>& locs, const vconfig& fi
|
|||||||
lexical_cast_default<size_t>(filter["radius"], 0));
|
lexical_cast_default<size_t>(filter["radius"], 0));
|
||||||
get_tiles_radius(*this, xy_locs, radius, locs);
|
get_tiles_radius(*this, xy_locs, radius, locs);
|
||||||
|
|
||||||
|
//handle [and], [or], and [not] with in-order precedence
|
||||||
config::all_children_iterator cond = filter.get_config().ordered_begin();
|
config::all_children_iterator cond = filter.get_config().ordered_begin();
|
||||||
config::all_children_iterator cond_end = filter.get_config().ordered_end();
|
config::all_children_iterator cond_end = filter.get_config().ordered_end();
|
||||||
int ors_left = std::count_if(cond, cond_end, cfg_isor());
|
int ors_left = std::count_if(cond, cond_end, cfg_isor());
|
||||||
while(cond != cond_end)
|
while(cond != cond_end)
|
||||||
{
|
{
|
||||||
|
//if there are no locations or [or] conditions left, go ahead and return empty
|
||||||
|
if(locs.empty() && ors_left <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const std::string& cond_name = *((*cond).first);
|
const std::string& cond_name = *((*cond).first);
|
||||||
const vconfig cond_filter(&(*((*cond).second)));
|
const vconfig cond_filter(&(*((*cond).second)));
|
||||||
|
|
||||||
@ -846,6 +852,7 @@ void gamemap::get_locations(std::set<gamemap::location>& locs, const vconfig& fi
|
|||||||
while(insert_itor != union_hexes.end()) {
|
while(insert_itor != union_hexes.end()) {
|
||||||
locs.insert(*insert_itor++);
|
locs.insert(*insert_itor++);
|
||||||
}
|
}
|
||||||
|
--ors_left;
|
||||||
}
|
}
|
||||||
//handle [not]
|
//handle [not]
|
||||||
else if(cond_name == "not") {
|
else if(cond_name == "not") {
|
||||||
@ -857,7 +864,6 @@ void gamemap::get_locations(std::set<gamemap::location>& locs, const vconfig& fi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if there are no locations or [or] conditions left, go ahead and return empty
|
|
||||||
++cond;
|
++cond;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user