From 53ab6f8128daf61ed20fdbafd26e0690e2770401 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 24 Dec 2022 16:25:06 +0200 Subject: [PATCH 11/11] 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 33e3324a0a..836f150902 100644 --- a/client/gui-sdl2/action_dialog.c +++ b/client/gui-sdl2/action_dialog.c @@ -1346,9 +1346,8 @@ static int upgrade_callback(struct widget *pWidget) { if (PRESSED_EVENT(Main.event)) { struct unit *punit; - struct city *pcity; - if ((pcity = game_city_by_number(pDiplomat_Dlg->target_ids[ATK_CITY])) + if (game_city_by_number(pDiplomat_Dlg->target_ids[ATK_CITY]) != NULL && (punit = game_unit_by_number(pDiplomat_Dlg->actor_unit_id))) { popup_unit_upgrade_dlg(punit, FALSE); } -- 2.35.1