From 0e842a173b71678fe33fed61e316e727a1c13e8e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 15 Jul 2022 02:23:17 +0300 Subject: [PATCH 42/42] sdl2: Keep sdip dialog as long as data is needed Some callbacks were closing sdip dialog first, then looking data from it. Reverse that. See osdn #45046 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/diplodlg.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/gui-sdl2/diplodlg.c b/client/gui-sdl2/diplodlg.c index 241e9b65f1..b5cc32bb4e 100644 --- a/client/gui-sdl2/diplodlg.c +++ b/client/gui-sdl2/diplodlg.c @@ -1302,12 +1302,11 @@ static int sdip_window_callback(struct widget *pwindow) static int withdraw_vision_dlg_callback(struct widget *pwidget) { if (PRESSED_EVENT(main_data.event)) { - popdown_sdip_dialog(); - dsend_packet_diplomacy_cancel_pact(&client.conn, player_number(pwidget->data.player), CLAUSE_VISION); + popdown_sdip_dialog(); flush_dirty(); } @@ -1320,12 +1319,11 @@ static int withdraw_vision_dlg_callback(struct widget *pwidget) static int cancel_pact_dlg_callback(struct widget *pwidget) { if (PRESSED_EVENT(main_data.event)) { - popdown_sdip_dialog(); - dsend_packet_diplomacy_cancel_pact(&client.conn, player_number(pwidget->data.player), CLAUSE_CEASEFIRE); + popdown_sdip_dialog(); flush_dirty(); } @@ -1338,14 +1336,13 @@ static int cancel_pact_dlg_callback(struct widget *pwidget) static int call_meeting_dlg_callback(struct widget *pwidget) { if (PRESSED_EVENT(main_data.event)) { - popdown_sdip_dialog(); - if (can_meet_with_player(pwidget->data.player)) { dsend_packet_diplomacy_init_meeting_req(&client.conn, player_number (pwidget->data.player)); } + popdown_sdip_dialog(); flush_dirty(); } -- 2.35.1