diff --git a/src/terrain/filter.cpp b/src/terrain/filter.cpp index 17d875cf971f..f4a4bca13040 100644 --- a/src/terrain/filter.cpp +++ b/src/terrain/filter.cpp @@ -154,7 +154,14 @@ bool terrain_filter::match_internal(const map_location& loc, const unit* ref_uni } } if (cfg_.has_attribute("location_id")) { - if (loc != fc_->get_disp_context().map().special_location(cfg_["location_id"])) { + std::set matching_locs; + for(const auto& id : utils::split(cfg_["location_id"])) { + map_location test_loc = fc_->get_disp_context().map().special_location(id); + if(test_loc.valid()) { + matching_locs.insert(test_loc); + } + } + if (matching_locs.count(loc) == 0) { return false; } } @@ -466,8 +473,14 @@ class terrain_filterimpl static void filter_special_loc(T&& src, location_set& dest, const terrain_filter& filter, const F1& f1, const F2& f2) { if (filter.cfg_.has_attribute("location_id")) { - map_location loc2 = filter.fc_->get_disp_context().map().special_location(filter.cfg_["location_id"]); - filter_final(src, dest, filter, f1, f2, [loc2](const map_location& loc) { return loc == loc2; }); + std::set matching_locs; + for(const auto& id : utils::split(filter.cfg_["location_id"])) { + map_location test_loc = filter.fc_->get_disp_context().map().special_location(id); + if(test_loc.valid()) { + matching_locs.insert(test_loc); + } + } + filter_final(src, dest, filter, f1, f2, [matching_locs](const map_location& loc) { return matching_locs.count(loc) > 0; }); } else { filter_final(src, dest, filter, f1, f2, no_filter()); @@ -543,9 +556,11 @@ void terrain_filter::get_locs_impl(std::set& locs, const unit* ref terrain_filterimpl::filter_special_loc(area, match_set, *this, terrain_filterimpl::no_filter(), terrain_filterimpl::no_filter()); } else if (cfg_.has_attribute("location_id")) { - map_location loc2 = fc_->get_disp_context().map().special_location(cfg_["location_id"]); - if (loc2.valid()) { - match_set.insert(loc2); + for(const auto& id : utils::split(cfg_["location_id"])) { + map_location test_loc = fc_->get_disp_context().map().special_location(id); + if(test_loc.valid()) { + match_set.insert(test_loc); + } } } else {