Skip to content

Commit

Permalink
Fixed most SUF keys matching all units if given "" as a value
Browse files Browse the repository at this point in the history
This was a regression from a6decea. We only want to ignore
keys if they're not provided. An empty key ("") should match nothing.

Fixes #1405 (a specific bug about id="" matching all units).
  • Loading branch information
Vultraz committed Feb 11, 2018
1 parent 298b448 commit edd6b8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelog
Expand Up @@ -96,6 +96,8 @@ Version 1.13.11:
* A missing [event] name= key will now raise a WML error instead of being
silently ignored.
* Units hidden with [hide_unit] will remain hidden after reloading saves.
* Fixed regression where most SUF keys would match all units if given "" as
a value.
* Miscellaneous and bug fixes:
* Suggested save file names now use spaces instead of underscores.
* Fixed crash after canceling add-on download (bug #2203)
Expand Down
2 changes: 1 addition & 1 deletion src/units/filter.cpp
Expand Up @@ -280,7 +280,7 @@ void unit_filter_compound::create_child(const vconfig& c, F func)
template<typename C, typename F>
void unit_filter_compound::create_attribute(const config::attribute_value v, C conv, F func)
{
if(v.empty()) {
if(v.blank()) {
}
else if(v.apply_visitor(contains_dollar_visitor())) {
children_.emplace_back(new unit_filter_attribute_literal<C, F>(std::move(v.str()), std::move(conv), std::move(func)));
Expand Down

0 comments on commit edd6b8d

Please sign in to comment.