Connect Engine: fix sides with their controller set as Empty still getting a leader
At some point in porting the MP Staging dialog to GUI2, I must have changed some behavior so that a leader still gets selected and written to the config even if the controller is set to empty. Since the presence of a type= key overrides no_leader, I just added an explicit check for the latter before writing type=.
This commit is contained in:
parent
98b2362604
commit
95b2d8c4e5
1 changed files with 8 additions and 2 deletions
|
@ -1084,8 +1084,14 @@ config side_engine::new_config() const
|
|||
}
|
||||
}
|
||||
}
|
||||
(*leader)["type"] = flg_.current_leader();
|
||||
(*leader)["gender"] = flg_.current_gender();
|
||||
|
||||
// NOTE: the presence of a type= key overrides no_leader. no_leader can be set by the
|
||||
// controller being set to CNTR_EMPTY, but to be safe we check the key specifically
|
||||
// here in case it was somehow included in the side config.
|
||||
if(!(*leader)["no_leader"].to_bool(false)) {
|
||||
(*leader)["type"] = flg_.current_leader();
|
||||
(*leader)["gender"] = flg_.current_gender();
|
||||
}
|
||||
|
||||
res["team_name"] = parent_.team_names_[team_];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue