mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-06 16:33:29 +00:00
fix 'start game' locked when other players abort flg dialog #3452
(cherry-picked from commit f03e3e8d6df84163f403d5860be7638084bd1481)
This commit is contained in:
parent
8f4c8540c3
commit
3e7c530c05
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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)) {
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user