mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-15 17:25:32 +00:00
fix unit(_type)::resistance_filter_matches
fix use of operator == (atribute_value, char*)
This commit is contained in:
parent
484d926c30
commit
606becd24b
@ -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"];
|
||||
|
@ -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"];
|
||||
|
Loading…
x
Reference in New Issue
Block a user