Skip to content

Commit

Permalink
Allow [effect]times=<integer>
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Mar 19, 2016
1 parent 0f1b21a commit cad89ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/unit.cpp
Expand Up @@ -2143,12 +2143,12 @@ void unit::add_modification(const std::string& mod_type, const config& mod, bool
if (resources::filter_con && !unit_filter(vconfig(afilter), resources::filter_con).matches(*this, loc_)) continue;
}
const std::string &apply_to = effect["apply_to"];
const std::string &apply_times = effect["times"];
int times = 1;
int times = effect["times"].to_int(1);
t_string description;

if (apply_times == "per level")
if (effect["times"] == "per level")
times = level_;

if (times) {
while (times > 0) {
times --;
Expand Down Expand Up @@ -2187,7 +2187,7 @@ void unit::add_modification(const std::string& mod_type, const config& mod, bool
}
}

if (apply_times == "per level" && !times) {
if (effect["times"] == "per level" && !times) {
utils::string_map symbols;
symbols["effect_description"] = description;
description = vgettext("$effect_description per level", symbols);
Expand Down

0 comments on commit cad89ef

Please sign in to comment.