mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-09 16:29:50 +00:00
fixed a not ideal return statement ending the function
This commit is contained in:
parent
40c53612e0
commit
056719cd44
@ -863,12 +863,13 @@ effect::effect(const unit_ability_list& list, int def, bool backstab) :
|
||||
if (const config::attribute_value *v = cfg.get("divide")) {
|
||||
if (*v == 0) {
|
||||
ERR_NG << "division by zero with division= in weapon special " << effect_id << "\n";
|
||||
return;
|
||||
}
|
||||
int divide = int(v->to_double() * 100);
|
||||
std::map<std::string,individual_effect>::iterator div_effect = values_div.find(effect_id);
|
||||
if(div_effect == values_div.end() || divide > div_effect->second.value) {
|
||||
values_div[effect_id].set(DIV,divide,i->first,i->second);
|
||||
else {
|
||||
int divide = int(v->to_double() * 100);
|
||||
std::map<std::string,individual_effect>::iterator div_effect = values_div.find(effect_id);
|
||||
if(div_effect == values_div.end() || divide > div_effect->second.value) {
|
||||
values_div[effect_id].set(DIV,divide,i->first,i->second);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user