diff --git a/src/unit.cpp b/src/unit.cpp index 31aa94824ad6..0f32ce975fc2 100644 --- a/src/unit.cpp +++ b/src/unit.cpp @@ -40,6 +40,8 @@ #include #include +#include +#include static lg::log_domain log_unit("unit"); #define DBG_UT LOG_STREAM(debug, log_unit) @@ -411,6 +413,14 @@ unit::unit(const config &cfg, bool use_traits, const vconfig* vcfg) : } while(++cfg_range.first != cfg_range.second); } + //If cfg specifies [advancement]s, replace this [advancement]s with them. + if(cfg.has_child("advancement")) + { + cfg_.clear_children("advancement"); + boost::copy( cfg.child_range("advancement") + , boost::make_function_output_iterator(boost::bind( &config::add_child, boost::ref(cfg_) /*thisptr*/, "advancement", _1 )) ); + } + //don't use the unit_type's abilities if this config has its own defined cfg_range = cfg.child_range("abilities"); if(cfg_range.first != cfg_range.second) {