Allow comma-separated list of ids in SUFs (FR bug #16720).
This commit is contained in:
parent
2d099daf23
commit
ea1d39cd9e
1 changed files with 16 additions and 3 deletions
19
src/unit.cpp
19
src/unit.cpp
|
@ -1223,9 +1223,22 @@ bool unit::internal_matches_filter(const vconfig& cfg, const map_location& loc,
|
|||
return false;
|
||||
}
|
||||
|
||||
config::attribute_value cfg_id = cfg["id"];
|
||||
if (!cfg_id.blank() && cfg_id.str() != id()) {
|
||||
return false;
|
||||
const config::attribute_value cfg_id = cfg["id"];
|
||||
if (!cfg_id.blank()) {
|
||||
const std::string& id = cfg_id;
|
||||
const std::string& this_id = this->id();
|
||||
|
||||
if (id == this_id) {
|
||||
}
|
||||
else if (std::find(id.begin(), id.end(), ',') == id.end()){
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
const std::vector<std::string>& ids = utils::split(id);
|
||||
if (std::find(ids.begin(), ids.end(), this_id) == ids.end()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Allow 'speaker' as an alternative to id, since people use it so often
|
||||
|
|
Loading…
Add table
Reference in a new issue