fix sides with no type= attribute
If you dont want that the engine uses the [side] wml table to create a leader for that side, it is now enough to just omit the type attribute. Previously it was necessary to add a no_leader=yes attribute. The no_leader attribute is still used by the mp connect engine (which is also used in sp) to prevent the mp connect engine from adding a random leader from the current era. no_leader now defaults to yes for sides in [scenario] and to no for sides in [multiplayer] so that the connect engine now by default doesn't add a random mp leader to sides in sp games.
This commit is contained in:
parent
acabc9201d
commit
163bdc9ecd
3 changed files with 6 additions and 2 deletions
|
@ -271,6 +271,10 @@ void game_config_manager::load_game_config(FORCE_RELOAD_CONFIG force_reload,
|
|||
scenario["require_scenario"] = require_campaign;
|
||||
// make force_lock_settings default to true for [scenario]
|
||||
scenario["force_lock_settings"] = scenario["force_lock_settings"].to_bool(true);
|
||||
BOOST_FOREACH(config& side, scenario.child_range("side"))
|
||||
{
|
||||
side["no_leader"] = side["no_leader"].to_bool(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -365,7 +365,7 @@ void flg_manager::update_available_leaders()
|
|||
{
|
||||
available_leaders_.clear();
|
||||
|
||||
if (!side_["no_leader"].to_bool() || !leader_lock_) {
|
||||
if (!default_leader_type_.empty() || !side_["no_leader"].to_bool() || !leader_lock_) {
|
||||
|
||||
int random_pos = 0;
|
||||
// Add a default leader if there is one.
|
||||
|
|
|
@ -258,7 +258,7 @@ protected:
|
|||
// this hack shall be removed, since it messes up with 'multiple leaders'
|
||||
|
||||
// If this side tag describes the leader of the side
|
||||
if (!side_cfg_["no_leader"].to_bool() && side_cfg_["controller"] != "null") {
|
||||
if (side_cfg_.has_attribute("type") && side_cfg_["type"] != "null" ) {
|
||||
handle_leader(side_cfg_);
|
||||
}
|
||||
BOOST_FOREACH(const config &l, side_cfg_.child_range("leader")) {
|
||||
|
|
Loading…
Add table
Reference in a new issue