fix 'start game' locked when other players abort flg dialog #3452

This commit is contained in:
gfgtdf 2018-08-11 22:28:59 +02:00
parent bd16aeec02
commit f03e3e8d6d
2 changed files with 4 additions and 4 deletions

View file

@ -186,7 +186,7 @@ bool mp_join_game::fetch_game_config()
// If the client is allowed to choose their team, do that here instead of having it set by the server
if((*side_choice)["allow_changes"].to_bool(true)) {
if(!show_flg_select(side_num_choice)) {
if(!show_flg_select(side_num_choice, true)) {
return false;
}
}
@ -267,7 +267,7 @@ void mp_join_game::pre_show(window& window)
plugins_context_->set_callback("chat", [&chat](const config& cfg) { chat.send_chat_message(cfg["message"], false); }, true);
}
bool mp_join_game::show_flg_select(int side_num)
bool mp_join_game::show_flg_select(int side_num, bool first_time)
{
if(const config& side_choice = get_scenario().child("side", side_num - 1)) {
if(!side_choice["allow_changes"].to_bool(true)) {
@ -308,7 +308,7 @@ bool mp_join_game::show_flg_select(int side_num)
flg_dialog_ = &flg_dialog;
utils::scope_exit se([this]() { flg_dialog_ = nullptr; });
if(!flg_dialog.show()) {
if(!flg_dialog.show() && !first_time) {
return true;
}
}

View file

@ -52,7 +52,7 @@ private:
virtual void post_show(window& window) override;
/** @returns false if an error ocurred. */
bool show_flg_select(int side_num);
bool show_flg_select(int side_num, bool first_time = false);
void generate_side_list(window& window);