Skip to content

Commit

Permalink
fix unit(_type)::resistance_filter_matches
Browse files Browse the repository at this point in the history
fix use of operator == (atribute_value, char*)
  • Loading branch information
gfgtdf committed Jun 27, 2014
1 parent 484d926 commit 606becd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/unit.cpp
Expand Up @@ -1811,7 +1811,7 @@ int unit::defense_modifier(const t_translation::t_terrain & terrain) const

bool unit::resistance_filter_matches(const config& cfg, bool attacker, const std::string& damage_name, int res) const
{
if(!(cfg["active_on"]=="" || (attacker && cfg["active_on"]=="offense") || (!attacker && cfg["active_on"]=="defense"))) {
if(!(cfg["active_on"].empty() || (attacker && cfg["active_on"]=="offense") || (!attacker && cfg["active_on"]=="defense"))) {
return false;
}
const std::string& apply_to = cfg["apply_to"];
Expand Down
2 changes: 1 addition & 1 deletion src/unit_types.cpp
Expand Up @@ -1110,7 +1110,7 @@ int unit_type::resistance_against(const std::string& damage_name, bool attacker)

bool unit_type::resistance_filter_matches(const config& cfg, bool attacker, const std::string& damage_name, int res) const
{
if(!(cfg["active_on"]=="" || (attacker && cfg["active_on"]=="offense") || (!attacker && cfg["active_on"]=="defense"))) {
if(!(cfg["active_on"].empty() || (attacker && cfg["active_on"]=="offense") || (!attacker && cfg["active_on"]=="defense"))) {
return false;
}
const std::string& apply_to = cfg["apply_to"];
Expand Down

0 comments on commit 606becd

Please sign in to comment.