From 5a5c60f2a1604ca550c361ee936e1f5493ac3aca Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 22 Sep 2023 14:47:49 +0300 Subject: [PATCH 10/10] sdl2: Fix add_global_worklist() dead 'buf' assignment See osdn #48688 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/wldlg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/gui-sdl2/wldlg.c b/client/gui-sdl2/wldlg.c index 42644007c5..78debbbe29 100644 --- a/client/gui-sdl2/wldlg.c +++ b/client/gui-sdl2/wldlg.c @@ -670,7 +670,6 @@ static int worklist_editor_item_callback(struct widget *pwidget) static void add_global_worklist(struct widget *pwidget) { struct global_worklist *gwl = global_worklist_by_id(MAX_ID - pwidget->id); - struct widget *buf = editor->work->end_active_widget_list; const struct worklist *pworklist; int count, firstfree; @@ -688,6 +687,8 @@ static void add_global_worklist(struct widget *pwidget) firstfree = worklist_length(&editor->worklist_copy); /* Copy global worklist to city worklist */ for (count = 0 ; count < worklist_length(pworklist); count++) { + struct widget *buf; + /* Global worklist can have targets unavilable in current state of game then we must remove those targets from new city worklist */ if (!can_city_build_later(editor->pcity, &pworklist->entries[count])) { -- 2.40.1