fix lowest sub used instead of highest

if heals with sub =8 and another heals with sub=4 it is sub=4 who is used. i changed this rule in effect for highest sub was used
This commit is contained in:
newfrenchy83 2018-12-03 00:28:09 +01:00 committed by gfgtdf
parent 5978228551
commit f264dc6c86

View file

@ -1215,7 +1215,7 @@ effect::effect(const unit_ability_list& list, int def, bool backstab) :
return formula.evaluate(callable).as_int();
});
std::map<std::string,individual_effect>::iterator sub_effect = values_add.find(effect_id);
if(sub_effect == values_add.end() || sub > sub_effect->second.value) {
if(sub_effect == values_add.end() || sub < sub_effect->second.value) {
values_add[effect_id].set(ADD, sub, ability.first, ability.second);
}
}