Skip to content

Commit

Permalink
revert rename bool_or_empty()
Browse files Browse the repository at this point in the history
  • Loading branch information
newfrenchy83 committed Oct 27, 2023
1 parent 40f318b commit 1ef867e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/units/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ static bool matches_ability_filter(const config & cfg, const std::string& tag_na
if(!bool_matches_if_present_and_valid(filter, cfg, "affect_self", true))
return false;

if(!matches_if_attribute_boolean_or_missing(filter, cfg, "affect_allies"))
if(!bool_or_empty(filter, cfg, "affect_allies"))
return false;

if(!bool_matches_if_present_and_valid(filter, cfg, "affect_enemies", false))
Expand Down
2 changes: 1 addition & 1 deletion src/utils/config_filters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ bool utils::config_filters::double_matches_if_present(const config& filter, cons
return in_ranges<double>(cfg[attribute].to_double(value_def), utils::parse_ranges_real(filter[attribute].str()));
}

bool utils::config_filters::matches_if_attribute_boolean_or_missing(const config& filter, const config& cfg, const std::string& attribute)
bool utils::config_filters::bool_or_empty(const config& filter, const config& cfg, const std::string& attribute)
{
if(!filter.has_attribute(attribute)) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/config_filters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ bool int_matches_if_present_or_negative(
bool string_matches_if_present(
const config& filter, const config& cfg, const std::string& attribute, const std::string& def);

bool matches_if_attribute_boolean_or_missing(const config& filter, const config& cfg, const std::string& attribute);
bool bool_or_empty(const config& filter, const config& cfg, const std::string& attribute);

} // namespace utils::config_filters

0 comments on commit 1ef867e

Please sign in to comment.