Skip to content

Commit

Permalink
Add ability_type_active to SUF
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed May 7, 2017
1 parent 7881575 commit 079b60a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/units/filter.cpp
Expand Up @@ -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()) {
Expand Down

0 comments on commit 079b60a

Please sign in to comment.