Navigation Menu

Skip to content

Commit

Permalink
fix 'start game' locked when other players abort flg dialog wesnoth#3452
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf authored and jostephd committed Oct 6, 2018
1 parent 20c1f8e commit e96f04a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/gui/dialogs/multiplayer/mp_join_game.cpp
Expand Up @@ -187,7 +187,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;
}
}
Expand Down Expand Up @@ -268,7 +268,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)) {
Expand Down Expand Up @@ -309,7 +309,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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/multiplayer/mp_join_game.hpp
Expand Up @@ -53,7 +53,7 @@ class mp_join_game : public modal_dialog, private plugin_executor
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);

Expand Down

0 comments on commit e96f04a

Please sign in to comment.