fix unit(_type)::resistance_filter_matches

fix use of operator == (atribute_value, char*)
This commit is contained in:
gfgtdf 2014-06-27 19:21:10 +02:00
parent 484d926c30
commit 606becd24b
2 changed files with 2 additions and 2 deletions

View File

@ -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"];

View File

@ -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"];