diff --git a/src/terrain/filter.cpp b/src/terrain/filter.cpp index a95d2df5e9acb..256f165f07089 100644 --- a/src/terrain/filter.cpp +++ b/src/terrain/filter.cpp @@ -107,6 +107,10 @@ bool terrain_filter::match_internal(const map_location& loc, const unit* ref_uni if (cfg_.has_attribute("area") && fc_->get_tod_man().get_area_by_id(cfg_["area"]).count(loc) == 0) return false; + + if(cfg_.has_attribute("gives_income") && + cfg_["gives_income"].to_bool() != fc_->get_disp_context().map().is_village(loc)) + return false; if(cfg_.has_attribute("terrain")) { if(cache_.parsed_terrain == nullptr) { @@ -548,6 +552,10 @@ void terrain_filter::get_locs_impl(std::set& locs, const unit* ref } } } + else if (cfg_["gives_income"].to_bool()) { + auto ar = fc_->get_disp_context().map().villages(); + terrain_filterimpl::filter_xy(ar, match_set, *this, with_border); + } else { //consider all locations on the map int bs = fc_->get_disp_context().map().border_size();