Skip to content

Commit

Permalink
fix apply_to=overlay effect
Browse files Browse the repository at this point in the history
previously [unit] overlays= would overwrite it, even when no overlays= is given.
  • Loading branch information
gfgtdf committed Jan 1, 2019
1 parent eb65c9b commit e710333
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/units/unit.cpp
Expand Up @@ -511,9 +511,11 @@ void unit::init(const config& cfg, bool use_traits, const vconfig* vcfg)
// Apply the unit type's data to this unit.
advance_to(*type_, use_traits);

overlays_ = utils::parenthetical_split(cfg["overlays"], ',');
if(overlays_.size() == 1 && overlays_.front().empty()) {
overlays_.clear();
if(const config::attribute_value* v = cfg.get("overlays")) {
overlays_ = utils::parenthetical_split(v->str(), ',');
if(overlays_.size() == 1 && overlays_.front().empty()) {
overlays_.clear();
}
}

if(const config& variables = cfg.child("variables")) {
Expand Down

0 comments on commit e710333

Please sign in to comment.