From f300d722a7c4880d7d9daaf50478d578acabc7ef Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 24 Dec 2022 16:30:04 +0200 Subject: [PATCH 22/22] sdl2: Drop unused 'pcity' from upgrade_callback() See osdn #46348 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/action_dialog.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/gui-sdl2/action_dialog.c b/client/gui-sdl2/action_dialog.c index 77940aea06..7a93a44bd3 100644 --- a/client/gui-sdl2/action_dialog.c +++ b/client/gui-sdl2/action_dialog.c @@ -687,9 +687,8 @@ static int upgrade_callback(struct widget *pwidget) { if (PRESSED_EVENT(main_data.event)) { struct unit *punit; - struct city *pcity; - if ((pcity = game_city_by_number(diplomat_dlg->target_ids[ATK_CITY])) + if (game_city_by_number(diplomat_dlg->target_ids[ATK_CITY]) != NULL && (punit = game_unit_by_number(diplomat_dlg->actor_unit_id))) { popup_unit_upgrade_dlg(punit, FALSE); } -- 2.35.1