Find the base unit type before applying a variation [effect].
Fixes bug #20604.
This commit is contained in:
parent
7dca188c77
commit
ee3d026dc2
1 changed files with 3 additions and 1 deletions
|
@ -2637,7 +2637,9 @@ void unit::add_modification(const std::string& mod_type, const config& mod, bool
|
|||
if (!last_effect.empty() && no_add == false) {
|
||||
if ((last_effect)["apply_to"] == "variation") {
|
||||
variation_ = last_effect["name"].str();
|
||||
advance_to(type());
|
||||
const unit_type * base_type = unit_types.find(type().base_id());
|
||||
assert(base_type != NULL);
|
||||
advance_to(*base_type);
|
||||
} else if ((last_effect)["apply_to"] == "type") {
|
||||
config::attribute_value &prev_type = (*new_child)["prev_type"];
|
||||
if (prev_type.blank()) prev_type = type().base_id();
|
||||
|
|
Loading…
Add table
Reference in a new issue