Add ability_type_active to SUF

This commit is contained in:
Celtic Minstrel 2017-05-07 13:09:32 -04:00
parent 7881575954
commit 079b60acbd

View file

@ -390,6 +390,20 @@ bool basic_unit_filter_impl::internal_matches_filter(const unit & u, const map_l
if (!match) return false;
}
if(!vcfg["ability_type_active"].empty()) {
bool match = false;
for(const std::string& ability : utils::split(vcfg["ability_type_active"])) {
if(!u.get_abilities(ability, loc).empty()) {
match = true;
break;
}
}
if(!match) {
return false;
}
}
if (!vcfg["race"].empty()) {
std::vector<std::string> races = utils::split(vcfg["race"]);
if (std::find(races.begin(), races.end(), u.race()->id()) == races.end()) {