Support special_active in SWF (Standard Weapon Filter)

This is the same as special but also requires it to be active.
This commit is contained in:
Celtic Minstrel 2017-05-11 12:41:52 -04:00
parent 1dff482acb
commit 6d910c0d42

View file

@ -102,6 +102,7 @@ static bool matches_simple_filter(const attack_type & attack, const config & fil
const std::vector<std::string> filter_name = utils::split(filter["name"]);
const std::vector<std::string> filter_type = utils::split(filter["type"]);
const std::string filter_special = filter["special"];
const std::string filter_special_active = filter["special_active"];
const std::string filter_formula = filter["formula"];
if ( !filter_range.empty() && std::find(filter_range.begin(), filter_range.end(), attack.range()) == filter_range.end() )
@ -131,6 +132,9 @@ static bool matches_simple_filter(const attack_type & attack, const config & fil
if ( !filter_special.empty() && !attack.get_special_bool(filter_special, true) )
return false;
if ( !filter_special_active.empty() && !attack.get_special_bool(filter_special_active, false) )
return false;
if (!filter_formula.empty()) {
try {
const wfl::attack_type_callable callable(attack);